[PATCH] D154188: [IRCE] Implement runtime overflow check for computed range's end

Aleksandr Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 30 00:12:17 PDT 2023


aleksandr.popov created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
aleksandr.popov requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Here is activated check eliminatition which was parsed previusly in
https://reviews.llvm.org/D154069

- Added runtime check that computed range's end doesn't overflow in

terms of range type. From the statement INT_MIN <= END <= INT_MAX is
inferred check: isNonNegative(INT_MAX - END) * isNonNegative(END - INT_MIN)

- If overflow happens, check will return 0 and the safe interval will be

empty

- Maximum size of range check type for which can be produced runtime

overflow check is limited by option with default value 32 bits


https://reviews.llvm.org/D154188

Files:
  llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
  llvm/test/Transforms/IRCE/iv-plus-offset-range-check.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154188.536126.patch
Type: text/x-patch
Size: 9944 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230630/3100041e/attachment.bin>


More information about the llvm-commits mailing list