[PATCH] D30993: [InstCombine] Liberate assert in InstCombiner::visitZExt

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 06:34:18 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL297952: [InstCombine] Liberate assert in InstCombiner::visitZExt (authored by bjope).

Changed prior to commit:
  https://reviews.llvm.org/D30993?vs=91981&id=91993#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D30993

Files:
  llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp


Index: llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp
===================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp
@@ -904,8 +904,8 @@
   unsigned BitsToClear;
   if ((DestTy->isVectorTy() || shouldChangeType(SrcTy, DestTy)) &&
       canEvaluateZExtd(Src, DestTy, BitsToClear, *this, &CI)) {
-    assert(BitsToClear < SrcTy->getScalarSizeInBits() &&
-           "Unreasonable BitsToClear");
+    assert(BitsToClear <= SrcTy->getScalarSizeInBits() &&
+           "Can't clear more bits than in SrcTy");
 
     // Okay, we can transform this!  Insert the new expression now.
     DEBUG(dbgs() << "ICE: EvaluateInDifferentType converting expression type"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30993.91993.patch
Type: text/x-patch
Size: 798 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170316/06a18395/attachment.bin>


More information about the llvm-commits mailing list