Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit f3303f0

Browse files
committed
[X86] Remove AddedComplexity from register form of NOT. NFCI
I believe isProfitableToFold will stop the load folding that this was intended to overcome. Given an (xor load, -1), isProfitableToFold will see that the immediate can be folded with the xor using a one byte immediate since it can be sign extended. It doesn't know about NOT, but the one byte immediate check is enough to stop the fold. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336712 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 43680a0 commit f3303f0

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

lib/Target/X86/X86InstrArithmetic.td

-3
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,6 @@ def NEG64m : RI<0xF7, MRM3m, (outs), (ins i64mem:$dst), "neg{q}\t$dst",
391391
// Note: NOT does not set EFLAGS!
392392

393393
let Constraints = "$src1 = $dst", SchedRW = [WriteALU] in {
394-
// Match xor -1 to not. Favors these over a move imm + xor to save code size.
395-
let AddedComplexity = 15 in {
396394
def NOT8r : I<0xF6, MRM2r, (outs GR8 :$dst), (ins GR8 :$src1),
397395
"not{b}\t$dst",
398396
[(set GR8:$dst, (not GR8:$src1))]>;
@@ -404,7 +402,6 @@ def NOT32r : I<0xF7, MRM2r, (outs GR32:$dst), (ins GR32:$src1),
404402
[(set GR32:$dst, (not GR32:$src1))]>, OpSize32;
405403
def NOT64r : RI<0xF7, MRM2r, (outs GR64:$dst), (ins GR64:$src1), "not{q}\t$dst",
406404
[(set GR64:$dst, (not GR64:$src1))]>;
407-
}
408405
} // Constraints = "$src1 = $dst", SchedRW
409406

410407
let SchedRW = [WriteALURMW] in {

0 commit comments

Comments
 (0)