[PATCH] D34666: [PatternMatch] Remove 64-bit or less restriction from m_SpecificInt

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 08:40:00 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL306417: [PatternMatch] Remove 64-bit or less restriction from m_SpecificInt (authored by ctopper).

Changed prior to commit:
  https://reviews.llvm.org/D34666?vs=104090&id=104181#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D34666

Files:
  llvm/trunk/include/llvm/IR/PatternMatch.h
  llvm/trunk/test/Transforms/InstCombine/select-cmp-cttz-ctlz.ll


Index: llvm/trunk/include/llvm/IR/PatternMatch.h
===================================================================
--- llvm/trunk/include/llvm/IR/PatternMatch.h
+++ llvm/trunk/include/llvm/IR/PatternMatch.h
@@ -399,10 +399,7 @@
       if (const auto *C = dyn_cast<Constant>(V))
         CI = dyn_cast_or_null<ConstantInt>(C->getSplatValue());
 
-    if (CI && CI->getBitWidth() <= 64)
-      return CI->getZExtValue() == Val;
-
-    return false;
+    return CI && CI->getValue() == Val;
   }
 };
 
Index: llvm/trunk/test/Transforms/InstCombine/select-cmp-cttz-ctlz.ll
===================================================================
--- llvm/trunk/test/Transforms/InstCombine/select-cmp-cttz-ctlz.ll
+++ llvm/trunk/test/Transforms/InstCombine/select-cmp-cttz-ctlz.ll
@@ -320,10 +320,8 @@
 
 define i128 @test7(i128 %x) {
 ; CHECK-LABEL: @test7(
-; CHECK-NEXT:    [[TMP0:%.*]] = tail call i128 @llvm.ctlz.i128(i128 [[X:%.*]], i1 true), !range !3
-; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp ne i128 [[X]], 0
-; CHECK-NEXT:    [[COND:%.*]] = select i1 [[TOBOOL]], i128 [[TMP0]], i128 128
-; CHECK-NEXT:    ret i128 [[COND]]
+; CHECK-NEXT:    [[TMP1:%.*]] = tail call i128 @llvm.ctlz.i128(i128 [[X:%.*]], i1 false), !range !3
+; CHECK-NEXT:    ret i128 [[TMP1]]
 ;
   %1 = tail call i128 @llvm.ctlz.i128(i128 %x, i1 true)
   %tobool = icmp ne i128 %x, 0
@@ -333,10 +331,8 @@
 
 define i128 @test8(i128 %x) {
 ; CHECK-LABEL: @test8(
-; CHECK-NEXT:    [[TMP0:%.*]] = tail call i128 @llvm.cttz.i128(i128 [[X:%.*]], i1 true), !range !3
-; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp ne i128 [[X]], 0
-; CHECK-NEXT:    [[COND:%.*]] = select i1 [[TOBOOL]], i128 [[TMP0]], i128 128
-; CHECK-NEXT:    ret i128 [[COND]]
+; CHECK-NEXT:    [[TMP1:%.*]] = tail call i128 @llvm.cttz.i128(i128 [[X:%.*]], i1 false), !range !3
+; CHECK-NEXT:    ret i128 [[TMP1]]
 ;
   %1 = tail call i128 @llvm.cttz.i128(i128 %x, i1 true)
   %tobool = icmp ne i128 %x, 0


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34666.104181.patch
Type: text/x-patch
Size: 1931 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170627/029e296a/attachment.bin>


More information about the llvm-commits mailing list