File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,9 @@ bool SPIRVLowerConstExprBase::visit(Module *M) {
124
124
auto *CE = cast<ConstantExpr>(V);
125
125
SPIRVDBG (dbgs () << " [lowerConstantExpressions] " << *CE;)
126
126
auto *ReplInst = CE->getAsInstruction ();
127
- auto *InsPoint = II->getParent () == &*FBegin ? II : &FBegin->back ();
127
+ auto InsPoint = II->getParent () == &*FBegin
128
+ ? II->getIterator ()
129
+ : FBegin->back ().getIterator ();
128
130
ReplInst->insertBefore (InsPoint);
129
131
SPIRVDBG (dbgs () << " -> " << *ReplInst << ' \n ' ;)
130
132
std::vector<Instruction *> Users;
@@ -140,7 +142,7 @@ bool SPIRVLowerConstExprBase::visit(Module *M) {
140
142
for (auto &User : Users) {
141
143
if (ReplInst->getParent () == User->getParent ())
142
144
if (User->comesBefore (ReplInst))
143
- ReplInst->moveBefore (User);
145
+ ReplInst->moveBefore (User-> getIterator () );
144
146
User->replaceUsesOfWith (CE, ReplInst);
145
147
}
146
148
Changed = true ;
You can’t perform that action at this time.
0 commit comments