[llvm] r337364 - [NFC][InstCombine] i65 tests for 'check for [no] signed truncation' pattern
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 18 01:49:51 PDT 2018
Author: lebedevri
Date: Wed Jul 18 01:49:51 2018
New Revision: 337364
URL: http://llvm.org/viewvc/llvm-project?rev=337364&view=rev
Log:
[NFC][InstCombine] i65 tests for 'check for [no] signed truncation' pattern
Those initially broke chromium build:
https://bugs.llvm.org/show_bug.cgi?id=38204 and
https://crbug.com/864832
Modified:
llvm/trunk/test/Transforms/InstCombine/canonicalize-lack-of-signed-truncation-check.ll
llvm/trunk/test/Transforms/InstCombine/canonicalize-signed-truncation-check.ll
Modified: llvm/trunk/test/Transforms/InstCombine/canonicalize-lack-of-signed-truncation-check.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/canonicalize-lack-of-signed-truncation-check.ll?rev=337364&r1=337363&r2=337364&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/canonicalize-lack-of-signed-truncation-check.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/canonicalize-lack-of-signed-truncation-check.ll Wed Jul 18 01:49:51 2018
@@ -26,6 +26,20 @@ define i1 @p0(i8 %x) {
ret i1 %tmp2
}
+; Big unusual bit width, https://bugs.llvm.org/show_bug.cgi?id=38204
+define i1 @pb(i65 %x) {
+; CHECK-LABEL: @pb(
+; CHECK-NEXT: [[TMP0:%.*]] = shl i65 [[X:%.*]], 1
+; CHECK-NEXT: [[TMP1:%.*]] = ashr exact i65 [[TMP0]], 1
+; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i65 [[TMP1]], [[X]]
+; CHECK-NEXT: ret i1 [[TMP2]]
+;
+ %tmp0 = shl i65 %x, 1
+ %tmp1 = ashr exact i65 %tmp0, 1
+ %tmp2 = icmp eq i65 %x, %tmp1
+ ret i1 %tmp2
+}
+
; ============================================================================ ;
; Vector tests
; ============================================================================ ;
Modified: llvm/trunk/test/Transforms/InstCombine/canonicalize-signed-truncation-check.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/canonicalize-signed-truncation-check.ll?rev=337364&r1=337363&r2=337364&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/canonicalize-signed-truncation-check.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/canonicalize-signed-truncation-check.ll Wed Jul 18 01:49:51 2018
@@ -26,6 +26,20 @@ define i1 @p0(i8 %x) {
ret i1 %tmp2
}
+; Big unusual bit width, https://bugs.llvm.org/show_bug.cgi?id=38204
+define i1 @pb(i65 %x) {
+; CHECK-LABEL: @pb(
+; CHECK-NEXT: [[TMP0:%.*]] = shl i65 [[X:%.*]], 1
+; CHECK-NEXT: [[TMP1:%.*]] = ashr exact i65 [[TMP0]], 1
+; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i65 [[TMP1]], [[X]]
+; CHECK-NEXT: ret i1 [[TMP2]]
+;
+ %tmp0 = shl i65 %x, 1
+ %tmp1 = ashr exact i65 %tmp0, 1
+ %tmp2 = icmp ne i65 %x, %tmp1
+ ret i1 %tmp2
+}
+
; ============================================================================ ;
; Vector tests
; ============================================================================ ;
More information about the llvm-commits
mailing list