[llvm] r321596 - [X86] Remove AND32ri8 from pattern for v1i1 load.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 30 23:38:33 PST 2017


Author: ctopper
Date: Sat Dec 30 23:38:33 2017
New Revision: 321596

URL: http://llvm.org/viewvc/llvm-project?rev=321596&view=rev
Log:
[X86] Remove AND32ri8 from pattern for v1i1 load.

I don't think anything would actually expect the other bits to be zero.

Modified:
    llvm/trunk/lib/Target/X86/X86InstrAVX512.td
    llvm/trunk/test/CodeGen/X86/avx512-calling-conv.ll

Modified: llvm/trunk/lib/Target/X86/X86InstrAVX512.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrAVX512.td?rev=321596&r1=321595&r2=321596&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrAVX512.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrAVX512.td Sat Dec 30 23:38:33 2017
@@ -2748,7 +2748,7 @@ let Predicates = [HasAVX512] in {
   def : Pat<(store (i16 (bitconvert (v16i1 VK16:$src))), addr:$dst),
             (KMOVWmk addr:$dst, VK16:$src)>;
   def : Pat<(v1i1 (load addr:$src)),
-            (COPY_TO_REGCLASS (AND32ri8 (MOVZX32rm8 addr:$src), (i32 1)), VK1)>;
+            (COPY_TO_REGCLASS (MOVZX32rm8 addr:$src), VK1)>;
   def : Pat<(v16i1 (bitconvert (i16 (load addr:$src)))),
             (KMOVWkm addr:$src)>;
 }

Modified: llvm/trunk/test/CodeGen/X86/avx512-calling-conv.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx512-calling-conv.ll?rev=321596&r1=321595&r2=321596&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/avx512-calling-conv.ll (original)
+++ llvm/trunk/test/CodeGen/X86/avx512-calling-conv.ll Sat Dec 30 23:38:33 2017
@@ -412,18 +412,23 @@ define i32 @test12(i32 %a1, i32 %a2, i32
 }
 
 define <1 x i1> @test13(<1 x i1>* %foo) {
-; ALL_X64-LABEL: test13:
-; ALL_X64:       ## %bb.0:
-; ALL_X64-NEXT:    movzbl (%rdi), %eax
-; ALL_X64-NEXT:    andl $1, %eax
-; ALL_X64-NEXT:    ## kill: def %al killed %al killed %eax
-; ALL_X64-NEXT:    retq
+; KNL-LABEL: test13:
+; KNL:       ## %bb.0:
+; KNL-NEXT:    movzbl (%rdi), %eax
+; KNL-NEXT:    ## kill: def %al killed %al killed %eax
+; KNL-NEXT:    retq
+;
+; SKX-LABEL: test13:
+; SKX:       ## %bb.0:
+; SKX-NEXT:    kmovb (%rdi), %k0
+; SKX-NEXT:    kmovd %k0, %eax
+; SKX-NEXT:    ## kill: def %al killed %al killed %eax
+; SKX-NEXT:    retq
 ;
 ; KNL_X32-LABEL: test13:
 ; KNL_X32:       ## %bb.0:
 ; KNL_X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
 ; KNL_X32-NEXT:    movzbl (%eax), %eax
-; KNL_X32-NEXT:    andl $1, %eax
 ; KNL_X32-NEXT:    ## kill: def %al killed %al killed %eax
 ; KNL_X32-NEXT:    retl
   %bar = load <1 x i1>, <1 x i1>* %foo




More information about the llvm-commits mailing list