Skip to content

Commit

Permalink
[X86] Remove AND32ri8 from pattern for v1i1 load.
Browse files Browse the repository at this point in the history
I don't think anything would actually expect the other bits to be zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321596 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
topperc committed Dec 31, 2017
1 parent 9e69c62 commit a17ce57
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/Target/X86/X86InstrAVX512.td
Original file line number Diff line number Diff line change
@@ -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)>;
}
19 changes: 12 additions & 7 deletions test/CodeGen/X86/avx512-calling-conv.ll
Original file line number Diff line number Diff line change
@@ -412,18 +412,23 @@ define i32 @test12(i32 %a1, i32 %a2, i32 %b1) {
}

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

0 comments on commit a17ce57

Please sign in to comment.