In llvm::UnrollRuntimeLoopRemainder, if the loop to be unrolled is the inner loop inside a loop nest, the scalar evolution needs to be dropped for its parent loop which is done by ScalarEvolution::forgetLoop. However, we can postpone forgetLoop to the end of UnrollRuntimeLoopRemainder so TripCountSC expansion can still reuse existing value.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Hi Wei,
I don't think I'm the best person to review this code, I think you should ask either @mzolotukhin or @evstupac.
Comment Actions
The change looks good to me, thanks!
Michael
test/Analysis/ScalarEvolution/scev-expander-existing-value.ll | ||
---|---|---|
1–2 | Would it make sense to separate the test into two files maybe? Right now we run opt twice on this file but only check the output of one half each run. Ideally, we could somehow use the same routine for both vectorizer and unroller runs, but I don't know if that's possible. |
Would it make sense to separate the test into two files maybe? Right now we run opt twice on this file but only check the output of one half each run. Ideally, we could somehow use the same routine for both vectorizer and unroller runs, but I don't know if that's possible.