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

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 14:41:10 PDT 2017


hfinkel added a comment.

Should we just abort the transformation in this case? Otherwise we just create an and with 0?



================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:908
+    assert(BitsToClear <= SrcTy->getScalarSizeInBits() &&
            "Unreasonable BitsToClear");
 
----------------
This assert message is not very useful. More useful might be:

  "Can't clear more bits than in SrcTy"



https://reviews.llvm.org/D30993





More information about the llvm-commits mailing list