| Index: src/IceInstX86Base.h
|
| diff --git a/src/IceInstX86Base.h b/src/IceInstX86Base.h
|
| index b53620847ad595498c485f85f480c7d553676acd..64bd859cbe3472e72488f55ec041c0133dd0bf63 100644
|
| --- a/src/IceInstX86Base.h
|
| +++ b/src/IceInstX86Base.h
|
| @@ -962,10 +962,10 @@ public:
|
| // mov cl, ecx ==> redundant
|
| // mov ch, ecx ==> not redundant due to different encodings
|
| // mov ch, ebp ==> not redundant due to different base registers
|
| - // TODO(stichnot): Don't consider "mov eax, eax" to be redundant when
|
| - // used in 64-bit mode to clear the upper half of rax.
|
| - int32_t SrcReg = SrcVar->getRegNum();
|
| - int32_t DestReg = this->Dest->getRegNum();
|
| + // mov ecx, ecx ==> redundant, and dangerous in x86-64. i64 zexting
|
| + // is handled by Inst86Zext.
|
| + const int32_t SrcReg = SrcVar->getRegNum();
|
| + const int32_t DestReg = this->Dest->getRegNum();
|
| return (InstX86Base<Machine>::Traits::getEncoding(SrcReg) ==
|
| InstX86Base<Machine>::Traits::getEncoding(DestReg)) &&
|
| (InstX86Base<Machine>::Traits::getBaseReg(SrcReg) ==
|
| @@ -1169,6 +1169,9 @@ class InstX86Mov
|
| : public InstX86BaseMovlike<Machine, InstX86Base<Machine>::Mov> {
|
| public:
|
| static InstX86Mov *create(Cfg *Func, Variable *Dest, Operand *Source) {
|
| + assert(!isScalarIntegerType(Dest->getType()) ||
|
| + (typeWidthInBytes(Dest->getType()) <=
|
| + typeWidthInBytes(Source->getType())));
|
| return new (Func->allocate<InstX86Mov>()) InstX86Mov(Func, Dest, Source);
|
| }
|
|
|
|
|