Skip to content

Commit

Permalink
merge r276347
Browse files Browse the repository at this point in the history
[X86] Do not use AND8ri8 in AVX512 pattern

This variant is (as documented in the TD) for disassembler use only, and should
not be used in patterns - it is longer, and is broken on 64-bit.

llvm-svn: 287855
  • Loading branch information
Guy Blank committed Nov 24, 2016
1 parent 7591dd9 commit cdf53e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Target/X86/X86InstrAVX512.td
Original file line number Diff line number Diff line change
Expand Up @@ -2124,7 +2124,7 @@ let Predicates = [HasAVX512] in {
(COPY_TO_REGCLASS (i16 (EXTRACT_SUBREG $src, sub_16bit)), VK1)>;

def : Pat<(i1 (trunc (i8 GR8:$src))),
(COPY_TO_REGCLASS (i16 (SUBREG_TO_REG (i64 0), (AND8ri8 $src, (i8 1)),
(COPY_TO_REGCLASS (i16 (SUBREG_TO_REG (i64 0), (AND8ri $src, (i8 1)),
sub_8bit)), VK1)>;

def : Pat<(i1 (trunc (i8 (assertzext_i1 GR8:$src)))),
Expand Down
18 changes: 18 additions & 0 deletions llvm/test/CodeGen/X86/no-and8ri8.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; RUN: llc -mtriple=x86_64-pc-linux -mattr=+avx512f --show-mc-encoding < %s | FileCheck %s

declare i1 @bar()

; CHECK-LABEL: @foo
; CHECK-NOT: andb {{.*}} # encoding: [0x82,
define i1 @foo(i1 %i) nounwind {
entry:
br i1 %i, label %if, label %else

if:
%r = call i1 @bar()
br label %else

else:
%ret = phi i1 [%r, %if], [true, %entry]
ret i1 %ret
}

0 comments on commit cdf53e3

Please sign in to comment.