[SCEVExpander] Expand explicit PtrToInt casts just like we would implicit ones
authorRoman Lebedev <lebedev.ri@gmail.com>
Mon, 19 Apr 2021 14:15:01 +0000 (17:15 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Mon, 19 Apr 2021 15:38:39 +0000 (18:38 +0300)
commitecc9d7e913eec96816499d0a328c6134281f8aad
tree76c73b008f6a1268d65a8fdea2b566a5b21e4f02
parent442c408e0e4a4d794752e710a362a5449d585432
[SCEVExpander] Expand explicit PtrToInt casts just like we would implicit ones

I.e., use GetOptimalInsertionPointForCastOf() helper to get the insertion
point, and try to reuse casts first.
llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll
llvm/test/Transforms/LoopDistribute/scev-inserted-runtime-check.ll