This change teaches isImpliedCond to infer things like "X sgt 0" => "X -
1 sgt -1".
The logic to do the heavy lifting is present in the ConstantRange
class, this change simply gets ScalarEvolution to exploit that when
reasonable.
Depends on D8345
Paths
| Differential D8346
[SCEV] Make isImpliedCond smarter. ClosedPublic Authored by sanjoy on Mar 15 2015, 2:25 AM.
Details Summary This change teaches isImpliedCond to infer things like "X sgt 0" => "X - The logic to do the heavy lifting is present in the ConstantRange Depends on D8345
Diff Detail
Event Timelinesanjoy updated this object. Comment Actions Hi Sanjoy, This looks ok, but is there any way to canonicalize (add-by-constant <pred> constant) before checking isImpliedCond? That way it would be symmetric and you wouldn't need separate logic to handle it. This revision is now accepted and ready to land.Mar 16 2015, 11:41 AM Closed by commit rL232576: [SCEV] Make isImpliedCond smarter. (authored by sanjoy). · Explain WhyMar 17 2015, 5:44 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 22150 llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
llvm/trunk/test/Analysis/ScalarEvolution/infer-via-ranges.ll
|