Chromium Code Reviews| Index: src/IceInstX86BaseImpl.h |
| diff --git a/src/IceInstX86BaseImpl.h b/src/IceInstX86BaseImpl.h |
| index cfc36d44a4fb3827d3329385015dc6de47a9631b..45563a7b62b5bc254ca88a47052da14e57fea97d 100644 |
| --- a/src/IceInstX86BaseImpl.h |
| +++ b/src/IceInstX86BaseImpl.h |
| @@ -2025,6 +2025,17 @@ template <typename TraitsType> |
| void InstImpl<TraitsType>::InstX86Lea::emit(const Cfg *Func) const { |
| if (!BuildDefs::dump()) |
| return; |
| + |
| + auto *MemOp = llvm::dyn_cast<X86OperandMem>(this->getSrc(0)); |
|
Jim Stichnoth
2016/07/29 14:27:26
This needs a comment to explain what's going on, w
|
| + if (MemOp && getFlags().getAggressiveLea() && |
|
Jim Stichnoth
2016/07/29 14:27:26
MemOp != nullptr
manasijm
2016/08/01 19:36:21
Done.
|
| + MemOp->getBase()->getRegNum() == this->getDest()->getRegNum() && |
| + MemOp->getIndex() == nullptr && MemOp->getShift() == 0) { |
| + auto *Add = InstImpl<TraitsType>::InstX86Add::create( |
| + const_cast<Cfg *>(Func), this->getDest(), MemOp->getOffset()); |
|
Jim Stichnoth
2016/07/29 14:27:26
const_cast - yuck! This often indicates a design
manasijm
2016/08/01 19:36:21
Done.
manasijm
2016/08/01 19:36:21
Using the allocator 'trick' does not seem to help
Jim Stichnoth
2016/08/01 21:08:41
well actually, asType() has the same problem with
|
| + Add->emit(Func); |
| + return; |
| + } |
| + |
| Ostream &Str = Func->getContext()->getStrEmit(); |
| assert(this->getSrcSize() == 1); |
| assert(this->getDest()->hasReg()); |