Have a single way for creating unique value names.
[oota-llvm.git] / test / Transforms / InstCombine / or.ll
index 5d6ca9603f79059aa75544e91400587e20d7c684..b91a5954d97edb7d7930fceb224c4563f15e602f 100644 (file)
@@ -394,7 +394,7 @@ define i32 @test37(i32* %xp, i32 %y) {
 ; CHECK: select i1 %tobool, i32 -1, i32 %x
   %tobool = icmp ne i32 %y, 0
   %sext = sext i1 %tobool to i32
-  %x = load i32* %xp
+  %x = load i32, i32* %xp
   %or = or i32 %sext, %x
   ret i32 %or
 }
@@ -404,7 +404,7 @@ define i32 @test38(i32* %xp, i32 %y) {
 ; CHECK: select i1 %tobool, i32 -1, i32 %x
   %tobool = icmp ne i32 %y, 0
   %sext = sext i1 %tobool to i32
-  %x = load i32* %xp
+  %x = load i32, i32* %xp
   %or = or i32 %x, %sext
   ret i32 %or
 }
@@ -480,3 +480,39 @@ define i32 @test45(i32 %x, i32 %y, i32 %z) {
   %or1 = or i32 %and, %y
   ret i32 %or1
 }
+
+define i1 @test46(i8 signext %c)  {
+  %c.off = add i8 %c, -97
+  %cmp1 = icmp ult i8 %c.off, 26
+  %c.off17 = add i8 %c, -65
+  %cmp2 = icmp ult i8 %c.off17, 26
+  %or = or i1 %cmp1, %cmp2
+  ret i1 %or
+; CHECK-LABEL: @test46(
+; CHECK-NEXT:  and i8 %c, -33
+; CHECK-NEXT:  add i8 %1, -65
+; CHECK-NEXT:  icmp ult i8 %2, 26
+}
+
+define i1 @test47(i8 signext %c)  {
+  %c.off = add i8 %c, -65
+  %cmp1 = icmp ule i8 %c.off, 26
+  %c.off17 = add i8 %c, -97
+  %cmp2 = icmp ule i8 %c.off17, 26
+  %or = or i1 %cmp1, %cmp2
+  ret i1 %or
+; CHECK-LABEL: @test47(
+; CHECK-NEXT:  and i8 %c, -33
+; CHECK-NEXT:  add i8 %1, -65
+; CHECK-NEXT:  icmp ult i8 %2, 27
+}
+
+define i1 @test48(i64 %x, i1 %b) {
+  %1 = icmp ult i64 %x, 2305843009213693952
+  %2 = icmp ugt i64 %x, 2305843009213693951
+  %.b = or i1 %2, %b
+  %3 = or i1 %1, %.b
+  ret i1 %3
+; CHECK-LABEL: @test48(
+; CHECK-NEXT:  ret i1 true
+}