mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-03 13:31:05 +00:00
AArch64: Follow-up to r212073
In r212073 I missed a call of `use_begin()` that assumed the wrong semantics. It's not clear to me at all what this code does without the fix, so I'm not sure how to write a testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212075 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
91fa94884d
commit
c3c8e7b79d
@ -285,10 +285,10 @@ AArch64AddressTypePromotion::propagateSignExtension(Instructions &SExtInsts) {
|
||||
// assertion on the type as all involved sext operation may have not
|
||||
// been moved yet.
|
||||
while (!Inst->use_empty()) {
|
||||
Value::use_iterator UseIt = Inst->use_begin();
|
||||
Instruction *UseInst = dyn_cast<Instruction>(*UseIt);
|
||||
assert(UseInst && "Use of sext is not an Instruction!");
|
||||
UseInst->setOperand(UseIt->getOperandNo(), SExt);
|
||||
Use &U = *Inst->use_begin();
|
||||
Instruction *User = dyn_cast<Instruction>(U.getUser());
|
||||
assert(User && "User of sext is not an Instruction!");
|
||||
User->setOperand(U.getOperandNo(), SExt);
|
||||
}
|
||||
ToRemove.insert(Inst);
|
||||
SExt->setOperand(0, Inst->getOperand(0));
|
||||
|
Loading…
Reference in New Issue
Block a user