aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
diff options
context:
space:
mode:
authorPhilip Reames <preames@rivosinc.com>2024-08-12 11:40:24 -0700
committerGitHub <noreply@github.com>2024-08-12 11:40:24 -0700
commitb812e57ac301c7f88171cc73e213b70078727b16 (patch)
treefdf90c8db527df95a619828a140a93814db9ba4a /llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
parentd4f6fcf5aaa0911a91317c0b06779f13077d6b58 (diff)
downloadllvm-b812e57ac301c7f88171cc73e213b70078727b16.zip
llvm-b812e57ac301c7f88171cc73e213b70078727b16.tar.gz
llvm-b812e57ac301c7f88171cc73e213b70078727b16.tar.bz2
[SCEV] Consolidate code for proving wrap flags of controlling finite IVs (#101404)
The canAssumeNoSelfWrap routine in howManyLessThans was doing two subtly inter-related things. First, it was proving no-self-wrap. This exactly duplicates the existing logic in the caller. Second, it was establishing the precondition for the nw->nsw/nuw inference. Specifically, we need to know that *this* exit must be taken for the inference to be sound. Otherwise, another (possible abnormal) exit could be taken in the iteration where this IV would become poison. This change moves all of that logic into the caller, and caches the resulting nuw/nsw flags in the AddRec. This centralizes the logic in one place, and makes it clear that it all depends on controlling the sole exit. We do loose a couple cases with SCEV predication. Specifically, if SCEV predication was able to convert e.g. zext(addrec) into an addrec(zext) using predication, but didn't record the nuw fact on the new addrec, then the consuming code can no longer fix this up. I don't think this case particularly matters. --------- Co-authored-by: Nikita Popov <github@npopov.com>
Diffstat (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions