Extended value is known to be inside range smaller than full set.
Prevent SCCP to mark such value as overdefined.
Fixes PR52253
Paths
| Differential D112721
[SCCP] Tune cast instruction handling for overdefined operand ClosedPublic Authored by anton-afanasyev on Oct 28 2021, 7:39 AM.
Details Summary Extended value is known to be inside range smaller than full set. Fixes PR52253
Diff Detail
Event Timeline
anton-afanasyev added inline comments.
anton-afanasyev retitled this revision from [SCCP] Tune `zext` and `sext` processing for overdefined operand to [SCCP] Tune `zext` and `sext` handling for overdefined operand.Nov 8 2021, 1:54 AM anton-afanasyev retitled this revision from [SCCP] Tune `zext` and `sext` handling for overdefined operand to [SCCP] Tune cast instruction handling for overdefined operand. Comment Actions Thanks for the update! I think with the latest changes applied, I noticed another potential simplification.
anton-afanasyev added inline comments.
Comment Actions LGTM, thanks!
This revision is now accepted and ready to land.Nov 8 2021, 6:40 AM This revision was landed with ongoing or failed builds.Nov 8 2021, 7:35 AM Closed by commit rGce4fa93db8b2: [SCCP] Tune cast instruction handling for overdefined operand (authored by anton-afanasyev). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 385467 llvm/lib/Transforms/Utils/SCCPSolver.cpp
llvm/test/Transforms/PhaseOrdering/X86/pr52253.ll
llvm/test/Transforms/SCCP/ip-ranges-casts.ll
llvm/test/Transforms/SCCP/overdefined-ext.ll
llvm/test/Transforms/SCCP/pr52253.ll
|
IIUC we need to check for range or overdefined here explicitly because we implicitly do not do anything for under or overdefined.
Could we instead add an early bail out on undeforunknown, only check for integer types here (and not constant range and overdefined) and drop the markOverdefined in the else of below?