Skip to content

Commit 8b711a9

Browse files
committed
Remove target opcode
1 parent 19192c4 commit 8b711a9

File tree

5 files changed

+9
-21
lines changed

5 files changed

+9
-21
lines changed

llvm/include/llvm/Support/TargetOpcodes.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,6 @@ HANDLE_TARGET_OPCODE(ICALL_BRANCH_FUNNEL)
225225
/// Represents a use of the operand but generates no code.
226226
HANDLE_TARGET_OPCODE(FAKE_USE)
227227

228-
/// Represents a point in a chain optimizations cannot remove.
229-
HANDLE_TARGET_OPCODE(CHAIN_BARRIER)
230-
231228
// This is a fence with the singlethread scope. It represents a compiler memory
232229
// barrier, but does not correspond to any generated instruction.
233230
HANDLE_TARGET_OPCODE(MEMBARRIER)

llvm/include/llvm/Target/Target.td

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,17 +1442,6 @@ def FAKE_USE : StandardPseudoInstruction {
14421442
}
14431443

14441444

1445-
def CHAIN_BARRIER : StandardPseudoInstruction {
1446-
// An instruction that takes a chain to mark that optimizations should not
1447-
// optimize any users of a chain that contains a CHAIN_BARRIER use a new chain
1448-
// from a point earlier than the CHAIN_BARRIER.
1449-
let OutOperandList = (outs);
1450-
let InOperandList = (ins variable_ops);
1451-
let AsmString = "CHAIN_BARRIER";
1452-
let hasSideEffects = 0;
1453-
let isMeta = true;
1454-
}
1455-
14561445
def PATCHABLE_OP : StandardPseudoInstruction {
14571446
let OutOperandList = (outs);
14581447
let InOperandList = (ins variable_ops);

llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2506,9 +2506,11 @@ void SelectionDAGISel::Select_FAKE_USE(SDNode *N) {
25062506
CurDAG->SelectNodeTo(N, TargetOpcode::FAKE_USE, N->getValueType(0),
25072507
N->getOperand(1), N->getOperand(0));
25082508
}
2509+
25092510
void SelectionDAGISel::Select_CHAIN_BARRIER(SDNode *N) {
2510-
CurDAG->SelectNodeTo(N, TargetOpcode::CHAIN_BARRIER, N->getValueType(0),
2511-
N->getOperand(0));
2511+
// CHAIN_BARRIER exists only for SDAG. Remove it before lowering to MIs.
2512+
CurDAG->ReplaceAllUsesWith(SDValue(N, 0), N->getOperand(0));
2513+
CurDAG->RemoveDeadNode(N);
25122514
}
25132515

25142516
void SelectionDAGISel::Select_FREEZE(SDNode *N) {

llvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@
7070
# DEBUG-NEXT: .. the first uncovered type index: 1, OK
7171
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
7272
#
73-
# DEBUG-NEXT: G_ABDS (opcode {{[0-9]+}}): 1 type index, 0 imm indices
73+
# DEBUG-NEXT: G_ABDS (opcode 65): 1 type index, 0 imm indices
7474
# DEBUG-NEXT:.. type index coverage check SKIPPED: no rules defined
7575
# DEBUG-NEXT:.. imm index coverage check SKIPPED: no rules defined
7676
#
77-
# DEBUG-NEXT:G_ABDU (opcode {{[0-9]+}}): 1 type index, 0 imm indices
77+
# DEBUG-NEXT:G_ABDU (opcode 66): 1 type index, 0 imm indices
7878
# DEBUG-NEXT:.. type index coverage check SKIPPED: no rules defined
7979
# DEBUG-NEXT:.. imm index coverage check SKIPPED: no rules defined
8080
#

llvm/test/CodeGen/RISCV/GlobalISel/legalizer-info-validation.mir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@
7272
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
7373
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
7474
#
75-
# DEBUG-NEXT: G_ABDS (opcode {{[0-9]+}}): 1 type index, 0 imm indices
75+
# DEBUG-NEXT: G_ABDS (opcode 65): 1 type index, 0 imm indices
7676
# DEBUG-NEXT:.. type index coverage check SKIPPED: no rules defined
7777
# DEBUG-NEXT:.. imm index coverage check SKIPPED: no rules defined
7878
#
79-
# DEBUG-NEXT:G_ABDU (opcode {{[0-9]+}}): 1 type index, 0 imm indices
79+
# DEBUG-NEXT:G_ABDU (opcode 66): 1 type index, 0 imm indices
8080
# DEBUG-NEXT:.. type index coverage check SKIPPED: no rules defined
8181
# DEBUG-NEXT:.. imm index coverage check SKIPPED: no rules defined
8282
#
@@ -579,7 +579,7 @@
579579
# DEBUG-NEXT: .. type index coverage check SKIPPED: no rules defined
580580
# DEBUG-NEXT: .. imm index coverage check SKIPPED: no rules defined
581581
# DEBUG-NEXT: G_FMINIMUM (opcode {{[0-9]+}}): 1 type index
582-
# DEBUG-NEXT: .. opcode {{[0-9]+}} is aliased to {{[0-9]+}}
582+
# DEBUG-NEXT: .. opcode 212 is aliased to 213
583583
# DEBUG-NEXT: .. type index coverage check SKIPPED: no rules defined
584584
# DEBUG-NEXT: .. imm index coverage check SKIPPED: no rules defined
585585
# DEBUG-NEXT: G_FMAXIMUM (opcode {{[0-9]+}}): 1 type index

0 commit comments

Comments
 (0)