Add an option to ConstantRange::print to print underlying APInt as
signed/unsigned number. Teach SCEV to print unsigned ranges. This helps
the human developer understand ranges without doing mental math of
converting signed ranges to unsigned ranges.
Details
Details
- Reviewers
mkazantsev fhahn nikic
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I'm okay with this, but just looking at the test diffs, I'm not sure how helpful this really is... I'd consider a range like [0,-3) to be easier to understand than [0,18446744073709551613), even when interpreting it in an unsigned sense.
Comment Actions
Yeah, I see what you mean now that I think about it again. I think its helpful for uint8, and maybe uint16, but beyond that the signed version is easier to read. We could add logic to print the unsigned version if its bitwidth is under some threshold, but it feels unnecessary.
I'll close this as won't fix.