[PATCH] D132443: [LSR] Fold terminal condition to other IV when possible

Yueh-Ting (eop) Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 01:19:12 PDT 2022


eopXD added inline comments.


================
Comment at: llvm/test/Transforms/LoopStrengthReduce/lsr-fold-iv-complicate-add-rec.ll:46
+for.body.preheader:                               ; preds = %entry
+  %add.ptr = getelementptr inbounds ptr, ptr %mark, i64 3
+  br label %for.body
----------------
fhahn wrote:
> is this needed?
Thanks for dropping by. Yes, my code checks if the phi node has a value that comes from the loop pre-header. Without this the condition check won't pass.


================
Comment at: llvm/test/Transforms/LoopStrengthReduce/lsr-fold-iv-complicate-add-rec.ll:50
+for.cond.cleanup.loopexit:                        ; preds = %for.body
+  br label %for.cond.cleanup
+
----------------
fhahn wrote:
> is this needed? Would be good to try to simplify the test as much as possible. Also, it would be good to add a patch just for the tests and then only include the diff here. 
Thanks for the reminder. Let me add a pre-commit test for this. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132443/new/

https://reviews.llvm.org/D132443



More information about the llvm-commits mailing list