This patch tries to transform cases like:
for (unsigned i = 0; i < N; i += 2) { bool c0 = (i & 0x1) == 0; bool c1 = ((i + 1) & 0x1) == 1; }
To
for (unsigned i = 0; i < N; i += 2) { bool c0 = true; bool c1 = true; }
Paths
| Differential D38272
[SimplifyIndVar] Constant fold IV users ClosedPublic Authored by etherzhhb on Sep 25 2017, 9:16 PM.
Details Summary This patch tries to transform cases like: for (unsigned i = 0; i < N; i += 2) { bool c0 = (i & 0x1) == 0; bool c1 = ((i + 1) & 0x1) == 1; } To for (unsigned i = 0; i < N; i += 2) { bool c0 = true; bool c1 = true; }
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Sep 25 2017, 10:05 PM
Closed by commit rL314266: [SimplifyIndVar] Constant fold IV users (authored by ether). · Explain WhySep 26 2017, 8:13 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 116642 lib/Transforms/Utils/SimplifyIndVar.cpp
test/Transforms/IndVarSimplify/constant-fold.ll
test/Transforms/IndVarSimplify/replace-srem-by-urem.ll
|
s/ParentLoop/L
ParentLoop would can be confused with the parent loop of the loop containing I