[llvm] r273995 - [X86 Target Lowering] Merged ICMP test.

Elena Demikhovsky via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 27 23:25:39 PDT 2016


Author: delena
Date: Tue Jun 28 01:25:38 2016
New Revision: 273995

URL: http://llvm.org/viewvc/llvm-project?rev=273995&view=rev
Log:
[X86 Target Lowering] Merged ICMP test.


Removed:
    llvm/trunk/test/CodeGen/X86/2016-06-28-ICmpCrash.ll
Modified:
    llvm/trunk/test/CodeGen/X86/cmp.ll

Removed: llvm/trunk/test/CodeGen/X86/2016-06-28-ICmpCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2016-06-28-ICmpCrash.ll?rev=273994&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2016-06-28-ICmpCrash.ll (original)
+++ llvm/trunk/test/CodeGen/X86/2016-06-28-ICmpCrash.ll (removed)
@@ -1,31 +0,0 @@
-;RUN: llc < %s -mcpu=core-avx2
-
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
-
-%struct.struct_1 = type { i24 }
-
- at a = global i8 0, align 1
- at b = global i8 0, align 1
- at d = global i8 0, align 1
- at e = global i8 0, align 1
- at c = global %struct.struct_1 zeroinitializer, align 4
-
-; Function Attrs: norecurse nounwind uwtable
-define void @_Z3fn1v() #0 {
-  %bf.load = load i32, i32* bitcast (%struct.struct_1* @c to i32*), align 4
-  %bf.shl = shl i32 %bf.load, 8
-  %bf.ashr = ashr exact i32 %bf.shl, 8
-  %tobool4 = icmp ne i32 %bf.ashr, 0
-  %conv = zext i1 %tobool4 to i32
-  %x1 = load i8, i8* @e, align 1
-  %conv6 = zext i8 %x1 to i32
-  %add = add nuw nsw i32 %conv, %conv6
-  %tobool7 = icmp ne i32 %add, 0
-  %frombool = zext i1 %tobool7 to i8
-  store i8 %frombool, i8* @b, align 1
-  %tobool14 = icmp ne i32 %bf.shl, 0
-  %frombool15 = zext i1 %tobool14 to i8
-  store i8 %frombool15, i8* @d, align 1
-  ret void
-}
\ No newline at end of file

Modified: llvm/trunk/test/CodeGen/X86/cmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cmp.ll?rev=273995&r1=273994&r2=273995&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/cmp.ll (original)
+++ llvm/trunk/test/CodeGen/X86/cmp.ll Tue Jun 28 01:25:38 2016
@@ -255,3 +255,30 @@ define zeroext i1 @test19(i32 %L) {
 ; CHECK:  testl   %edi, %edi
 ; CHECK:  setns   %al
 }
+
+ at d = global i8 0, align 1
+
+; This test failed due to incorrect handling of "shift + icmp" sequence
+define void @test20(i32 %bf.load, i8 %x1, i8* %b_addr) {
+  %bf.shl = shl i32 %bf.load, 8
+  %bf.ashr = ashr exact i32 %bf.shl, 8
+  %tobool4 = icmp ne i32 %bf.ashr, 0
+  %conv = zext i1 %tobool4 to i32
+  %conv6 = zext i8 %x1 to i32
+  %add = add nuw nsw i32 %conv, %conv6
+  %tobool7 = icmp ne i32 %add, 0
+  %frombool = zext i1 %tobool7 to i8
+  store i8 %frombool, i8* %b_addr, align 1
+  %tobool14 = icmp ne i32 %bf.shl, 0
+  %frombool15 = zext i1 %tobool14 to i8
+  store i8 %frombool15, i8* @d, align 1
+  ret void
+
+; CHECK-LABEL: test20
+; CHECK: andl
+; CHECK: setne
+; CHECK: addl
+; CHECK: setne
+; CHECK: testl
+; CHECK: setne
+}
\ No newline at end of file




More information about the llvm-commits mailing list