Skip to content

Commit eed75a9

Browse files
committed
Fix td file for OpMerge + OpBranch instructions
All OpBranch should be marked as IsBarrier so MIR knows it can be used as the last instruction of a BB, and Op*Merge operands should be marked as "unknown" as the backend transforms those to spirv labels, which meaning the MIR verified doesn't interpret as BB labels. Signed-off-by: Nathan Gauër <[email protected]>
1 parent 07d7ec8 commit eed75a9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Target/SPIRV/SPIRVInstrInfo.td

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -617,15 +617,13 @@ def OpFwidthCoarse: UnOp<"OpFwidthCoarse", 215>;
617617

618618
def OpPhi: Op<245, (outs ID:$res), (ins TYPE:$type, ID:$var0, ID:$block0, variable_ops),
619619
"$res = OpPhi $type $var0 $block0">;
620-
def OpLoopMerge: Op<246, (outs), (ins ID:$merge, ID:$continue, LoopControl:$lc, variable_ops),
620+
def OpLoopMerge: Op<246, (outs), (ins unknown:$merge, unknown:$continue, LoopControl:$lc, variable_ops),
621621
"OpLoopMerge $merge $continue $lc">;
622-
def OpSelectionMerge: Op<247, (outs), (ins ID:$merge, SelectionControl:$sc),
622+
def OpSelectionMerge: Op<247, (outs), (ins unknown:$merge, SelectionControl:$sc),
623623
"OpSelectionMerge $merge $sc">;
624624
def OpLabel: Op<248, (outs ID:$label), (ins), "$label = OpLabel">;
625625
let isBarrier = 1, isTerminator=1 in {
626626
def OpBranch: Op<249, (outs), (ins unknown:$label), "OpBranch $label">;
627-
}
628-
let isTerminator=1 in {
629627
def OpBranchConditional: Op<250, (outs), (ins ID:$cond, unknown:$true, unknown:$false, variable_ops),
630628
"OpBranchConditional $cond $true $false">;
631629
def OpSwitch: Op<251, (outs), (ins ID:$sel, ID:$dflt, variable_ops), "OpSwitch $sel $dflt">;

0 commit comments

Comments
 (0)