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

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 02:52:14 PDT 2017


bjope updated this revision to Diff 91981.
bjope added a comment.

Updated the assert message (as suggested by hfinkel).
Minor updates to the summary.


https://reviews.llvm.org/D30993

Files:
  lib/Transforms/InstCombine/InstCombineCasts.cpp


Index: lib/Transforms/InstCombine/InstCombineCasts.cpp
===================================================================
--- lib/Transforms/InstCombine/InstCombineCasts.cpp
+++ 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.91981.patch
Type: text/x-patch
Size: 765 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170316/8513afbf/attachment.bin>


More information about the llvm-commits mailing list