Skip to content

Commit a04dc34

Browse files
committed
[ser] Make BarrierRequiresReorder conform to the LLVM Coding Standards
1 parent 1d8695d commit a04dc34

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

lib/DXIL/DxilOperations.cpp

+15-18
Original file line numberDiff line numberDiff line change
@@ -3008,32 +3008,29 @@ bool OP::BarrierRequiresNode(const llvm::CallInst *CI) {
30083008
}
30093009

30103010
bool OP::BarrierRequiresReorder(const llvm::CallInst *CI) {
3011-
OpCode opcode = OP::GetDxilOpFuncCallInst(CI);
3012-
switch (opcode) {
3011+
OpCode Opcode = OP::GetDxilOpFuncCallInst(CI);
3012+
switch (Opcode) {
30133013
case OpCode::BarrierByMemoryType: {
3014-
DxilInst_BarrierByMemoryType barrier(const_cast<CallInst *>(CI));
3015-
if (isa<ConstantInt>(barrier.get_SemanticFlags())) {
3016-
unsigned semanticFlags = barrier.get_SemanticFlags_val();
3017-
return (semanticFlags &
3018-
static_cast<unsigned>(DXIL::BarrierSemanticFlag::ReorderScope)) !=
3019-
0U;
3020-
}
3021-
return false;
3014+
DxilInst_BarrierByMemoryType Barrier(const_cast<CallInst *>(CI));
3015+
if (!isa<ConstantInt>(Barrier.get_SemanticFlags()))
3016+
return false;
3017+
unsigned SemanticFlags = Barrier.get_SemanticFlags_val();
3018+
return (SemanticFlags & static_cast<unsigned>(
3019+
DXIL::BarrierSemanticFlag::ReorderScope)) != 0U;
30223020
}
30233021
case OpCode::BarrierByMemoryHandle: {
3024-
DxilInst_BarrierByMemoryHandle barrier(const_cast<CallInst *>(CI));
3025-
if (isa<ConstantInt>(barrier.get_SemanticFlags())) {
3026-
unsigned semanticFlags = barrier.get_SemanticFlags_val();
3027-
return (semanticFlags &
3028-
static_cast<unsigned>(DXIL::BarrierSemanticFlag::ReorderScope)) !=
3029-
0U;
3030-
}
3031-
return false;
3022+
DxilInst_BarrierByMemoryHandle Barrier(const_cast<CallInst *>(CI));
3023+
if (!isa<ConstantInt>(Barrier.get_SemanticFlags()))
3024+
return false;
3025+
unsigned SemanticFlags = Barrier.get_SemanticFlags_val();
3026+
return (SemanticFlags & static_cast<unsigned>(
3027+
DXIL::BarrierSemanticFlag::ReorderScope)) != 0U;
30323028
}
30333029
default:
30343030
return false;
30353031
}
30363032
}
3033+
30373034
DXIL::BarrierMode OP::TranslateToBarrierMode(const llvm::CallInst *CI) {
30383035
OpCode opcode = OP::GetDxilOpFuncCallInst(CI);
30393036
switch (opcode) {

0 commit comments

Comments
 (0)