[llvm-branch-commits] [llvm-branch] r287855 - merge r276347

Guy Blank via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Nov 23 22:52:24 PST 2016


Author: guyblank
Date: Thu Nov 24 00:52:24 2016
New Revision: 287855

URL: http://llvm.org/viewvc/llvm-project?rev=287855&view=rev
Log:
merge r276347

[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.


Added:
    llvm/branches/release_39/test/CodeGen/X86/no-and8ri8.ll
Modified:
    llvm/branches/release_39/lib/Target/X86/X86InstrAVX512.td

Modified: llvm/branches/release_39/lib/Target/X86/X86InstrAVX512.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_39/lib/Target/X86/X86InstrAVX512.td?rev=287855&r1=287854&r2=287855&view=diff
==============================================================================
--- llvm/branches/release_39/lib/Target/X86/X86InstrAVX512.td (original)
+++ llvm/branches/release_39/lib/Target/X86/X86InstrAVX512.td Thu Nov 24 00:52:24 2016
@@ -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)))),

Added: llvm/branches/release_39/test/CodeGen/X86/no-and8ri8.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_39/test/CodeGen/X86/no-and8ri8.ll?rev=287855&view=auto
==============================================================================
--- llvm/branches/release_39/test/CodeGen/X86/no-and8ri8.ll (added)
+++ llvm/branches/release_39/test/CodeGen/X86/no-and8ri8.ll Thu Nov 24 00:52:24 2016
@@ -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
+}




More information about the llvm-branch-commits mailing list