[llvm-commits] [llvm] r41775 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.td lib/Target/X86/X86InstrSSE.td lib/Target/X86/X86InstrX86-64.td test/CodeGen/X86/zero-remat.ll
Evan Cheng
evan.cheng at apple.com
Mon Sep 10 13:27:28 PDT 2007
Hi Dan,
This is not safe because xor will clobber flags. It's a miscompilation
if the user of the rematerialized value is a conditional move (e.g.
cmovne).
The current fix is to X86RegisterInfo::reMaterialize() should
rematerialize it as a move instruction.
Evan
On Sep 7, 2007, at 2:32 PM, Dan Gohman wrote:
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
> +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Fri Sep 7 16:32:51 2007
> @@ -2313,6 +2313,7 @@
>
> // Alias instructions that map movr0 to xor.
> // FIXME: remove when we can teach regalloc that xor reg, reg is ok.
> +let isReMaterializable = 1 in {
> def MOV8r0 : I<0x30, MRMInitReg, (outs GR8 :$dst), (ins),
> "xor{b}\t$dst, $dst",
> [(set GR8:$dst, 0)]>;
> @@ -2322,6 +2323,7 @@
> def MOV32r0 : I<0x31, MRMInitReg, (outs GR32:$dst), (ins),
> "xor{l}\t$dst, $dst",
> [(set GR32:$dst, 0)]>;
> +}
>
More information about the llvm-commits
mailing list