[X86] Avoid over-relaxation of 8-bit immediates in integer arithmetic instructions.
authorMichael Kuperstein <michael.m.kuperstein@intel.com>
Wed, 1 Jul 2015 10:54:42 +0000 (10:54 +0000)
committerMichael Kuperstein <michael.m.kuperstein@intel.com>
Wed, 1 Jul 2015 10:54:42 +0000 (10:54 +0000)
commit5020a9198dc730a34f5f6de58735e8af0965746f
tree650852af63e8872668c4238c1ee2762d4c76f189
parent275fa93acf5eeb6a35f58e733c78b1d2f55e2c81
[X86] Avoid over-relaxation of 8-bit immediates in integer arithmetic instructions.

Only consider an instruction a candidate for relaxation if the last operand of the
instruction is an expression. We previously checked whether any operand is an expression,
which is useless, since for all instructions concerned, the only operand that may be
affected by relaxation is the last one.
In addition, this removes the check for having RIP as an argument, since it was
plain wrong - even when one of the arguments is RIP, relaxation may still be needed.

This fixes PR9807.

Patch by: david.l.kreitzer@intel.com
Differential Revision: http://reviews.llvm.org/D10766

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241152 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
test/MC/ELF/relax-arith2.s [new file with mode: 0644]
test/MC/ELF/relax-arith3.s [new file with mode: 0644]