[SCEV] Simplify trunc to zero based on known bits
authorGil Rapaport <gil.rapaport@intel.com>
Wed, 30 Dec 2020 21:11:20 +0000 (23:11 +0200)
committerGil Rapaport <gil.rapaport@intel.com>
Sun, 3 Jan 2021 11:57:12 +0000 (13:57 +0200)
commitd9c0b128e3543d5d30f43019257bfd96ce4cdcd1
tree46bbdbddf15dbe0607745e132ef41e450fe048ac
parentf5f7ff8d0faacf4813e38081e551b9ab6cdc76ae
[SCEV] Simplify trunc to zero based on known bits

Let getTruncateExpr() short-circuit to zero when the value being truncated is
known to have at least as many trailing zeros as the target type.

Differential Revision: https://reviews.llvm.org/D93973
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/trunc-simplify.ll
llvm/test/Transforms/LoopVectorize/dont-fold-tail-for-assumed-divisible-TC.ll