[llvm] r275376 - [X86] Fix stupid typo in isel lowering.
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 13 22:48:25 PDT 2016
Author: efriedma
Date: Thu Jul 14 00:48:25 2016
New Revision: 275376
URL: http://llvm.org/viewvc/llvm-project?rev=275376&view=rev
Log:
[X86] Fix stupid typo in isel lowering.
Apparently someone miscounted the number of zeros in the immediate.
Fixes https://llvm.org/bugs/show_bug.cgi?id=28544 .
Modified:
llvm/trunk/lib/Target/X86/X86InstrCompiler.td
llvm/trunk/test/CodeGen/X86/add.ll
Modified: llvm/trunk/lib/Target/X86/X86InstrCompiler.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrCompiler.td?rev=275376&r1=275375&r2=275376&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrCompiler.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrCompiler.td Thu Jul 14 00:48:25 2016
@@ -1405,7 +1405,7 @@ def : Pat<(store (add (loadi64 addr:$dst
// instructions.
def : Pat<(add GR64:$src1, 0x0000000080000000),
(SUB64ri32 GR64:$src1, 0xffffffff80000000)>;
-def : Pat<(store (add (loadi64 addr:$dst), 0x00000000800000000), addr:$dst),
+def : Pat<(store (add (loadi64 addr:$dst), 0x0000000080000000), addr:$dst),
(SUB64mi32 addr:$dst, 0xffffffff80000000)>;
// To avoid needing to materialize an immediate in a register, use a 32-bit and
Modified: llvm/trunk/test/CodeGen/X86/add.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/add.ll?rev=275376&r1=275375&r2=275376&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/add.ll (original)
+++ llvm/trunk/test/CodeGen/X86/add.ll Thu Jul 14 00:48:25 2016
@@ -148,3 +148,39 @@ entry:
; X64: incl
; X64-NEXT: seto
}
+
+define void @test11(i32* inreg %a) nounwind {
+ %aa = load i32, i32* %a
+ %b = add i32 %aa, 128
+ store i32 %b, i32* %a
+ ret void
+; X32-LABEL: test11:
+; X32: subl $-128, (%
+; X64-LABEL: test11:
+; X64: subl $-128, (%
+}
+
+define void @test12(i64* inreg %a) nounwind {
+ %aa = load i64, i64* %a
+ %b = add i64 %aa, 2147483648
+ store i64 %b, i64* %a
+ ret void
+; X32-LABEL: test12:
+; X32: addl (%
+; X32-NEXT: adcl $0,
+; X64-LABEL: test12:
+; X64: subq $-2147483648, (%
+}
+
+define void @test13(i64* inreg %a) nounwind {
+ %aa = load i64, i64* %a
+ %b = add i64 %aa, 128
+ store i64 %b, i64* %a
+ ret void
+
+; X32-LABEL: test13:
+; X32: addl (%
+; X32-NEXT: adcl $0,
+; X64-LABEL: test13:
+; X64: subq $-128, (%
+}
More information about the llvm-commits
mailing list