[llvm] r212075 - AArch64: Follow-up to r212073
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Jun 30 17:05:38 PDT 2014
Author: dexonsmith
Date: Mon Jun 30 19:05:37 2014
New Revision: 212075
URL: http://llvm.org/viewvc/llvm-project?rev=212075&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Target/AArch64/AArch64AddressTypePromotion.cpp
Modified: llvm/trunk/lib/Target/AArch64/AArch64AddressTypePromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64AddressTypePromotion.cpp?rev=212075&r1=212074&r2=212075&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64AddressTypePromotion.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64AddressTypePromotion.cpp Mon Jun 30 19:05:37 2014
@@ -285,10 +285,10 @@ AArch64AddressTypePromotion::propagateSi
// 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));
More information about the llvm-commits
mailing list