Chromium Code Reviews| Index: src/IceTargetLoweringX86BaseImpl.h |
| diff --git a/src/IceTargetLoweringX86BaseImpl.h b/src/IceTargetLoweringX86BaseImpl.h |
| index 2f6bfaca1a5f71cb846d4d35e81a0d250ed9ac28..d5a9debfb7c50a2c04ee4c0f83c756d4da9e777d 100644 |
| --- a/src/IceTargetLoweringX86BaseImpl.h |
| +++ b/src/IceTargetLoweringX86BaseImpl.h |
| @@ -809,7 +809,7 @@ template <typename TraitsType> void TargetX86Base<TraitsType>::doLoadOpt() { |
| while (!Context.atEnd()) { |
| Variable *LoadDest = nullptr; |
| Operand *LoadSrc = nullptr; |
| - Inst *CurInst = Context.getCur(); |
| + Inst *CurInst = iteratorToInst(Context.getCur()); |
|
Eric Holk
2016/08/17 00:33:46
Would just `*Context.getCur()` work?
Jim Stichnoth
2016/08/17 04:43:30
Given that the original code was:
Inst *CurInst
|
| Inst *Next = Context.getNextInst(); |
| // Determine whether the current instruction is a Load instruction or |
| // equivalent. |
| @@ -5680,7 +5680,7 @@ template <typename TraitsType> |
| void TargetX86Base<TraitsType>::doAddressOptOther() { |
| // Inverts some Icmp instructions which helps doAddressOptLoad later. |
| // TODO(manasijm): Refactor to unify the conditions for Var0 and Var1 |
| - Inst *Instr = Context.getCur(); |
| + Inst *Instr = iteratorToInst(Context.getCur()); |
| auto *VMetadata = Func->getVMetadata(); |
| if (auto *Icmp = llvm::dyn_cast<InstIcmp>(Instr)) { |
| if (llvm::isa<Constant>(Icmp->getSrc(0)) || |
| @@ -5711,7 +5711,7 @@ void TargetX86Base<TraitsType>::doAddressOptOther() { |
| template <typename TraitsType> |
| void TargetX86Base<TraitsType>::doAddressOptLoad() { |
| - Inst *Instr = Context.getCur(); |
| + Inst *Instr = iteratorToInst(Context.getCur()); |
| Operand *Addr = Instr->getSrc(0); |
| Variable *Dest = Instr->getDest(); |
| if (auto *OptAddr = computeAddressOpt(Instr, Dest->getType(), Addr)) { |