Skip to content

Commit 7a6a52a

Browse files
authored
[SandboxIR] Remove incorrect assertion. (#115553)
`insertBefore` can be called on a detached instruction, and we can't check that the underlying instructions are ordered because instructions without BB parents have no order. This problem showed up as a different assertion failure in `llvm::Instruction::comesBefore` in one of the unit tests when `EXPENSIVE_CHECKS` are enabled.
1 parent 8d8d9f0 commit 7a6a52a

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

llvm/lib/SandboxIR/Instruction.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,6 @@ void Instruction::moveBefore(BasicBlock &BB, const BBIterator &WhereIt) {
124124

125125
void Instruction::insertBefore(Instruction *BeforeI) {
126126
llvm::Instruction *BeforeTopI = BeforeI->getTopmostLLVMInstruction();
127-
// TODO: Move this to the verifier of sandboxir::Instruction.
128-
assert(is_sorted(getLLVMInstrs(),
129-
[](auto *I1, auto *I2) { return I1->comesBefore(I2); }) &&
130-
"Expected program order!");
131127

132128
Ctx.getTracker().emplaceIfTracking<InsertIntoBB>(this);
133129

0 commit comments

Comments
 (0)