Specifically, we transform
zext(2^K * (trunc X to iN)) to iM -> 2^K * (zext(trunc X to i{N-K}) to iM)<nuw>
This is helpful because pulling the 2^K out of the zext allows further
optimizations.
Paths
| Differential D48158
[SCEV] Simplify zext/trunc idiom that appears when handling bitmasks. ClosedPublic Authored by jlebar on Jun 13 2018, 8:32 PM.
Details Summary Specifically, we transform zext(2^K * (trunc X to iN)) to iM -> 2^K * (zext(trunc X to i{N-K}) to iM)<nuw> This is helpful because pulling the 2^K out of the zext allows further
Diff Detail
Event TimelineComment Actions lgtm
This revision is now accepted and ready to land.Jun 14 2018, 10:01 AM Closed by commit rL334737: [SCEV] Simplify zext/trunc idiom that appears when handling bitmasks. (authored by jlebar). · Explain WhyJun 14 2018, 10:20 AM This revision was automatically updated to reflect the committed changes. jlebar marked 2 inline comments as done.
Revision Contents
Diff 151300 llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll
llvm/test/Analysis/ScalarEvolution/and-xor.ll
|
SA is a bad name for a SCEVMulExpr -- should be SM or Mul. Do you mind fixing this in a followup CL while you're here?