[PATCH] D138636: [LSR] Hoist IVInc to loop header if its all uses are in the loop header
chenglin.bi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 2 19:34:15 PST 2023
bcl5980 added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:5681
+
+ Instruction *I = Fixup.UserInst;
+ if ((isa<LoadInst>(I) &&
----------------
eopXD wrote:
> bcl5980 wrote:
> > eopXD wrote:
> > > This looks familiar with `mayUsePostIncMode`
> > It looks `mayUsePostIncMode` is not what I want. It only checks the instruction is legal but haven't check the instruction opcode.
> ```
> if ((isa<LoadInst>(I) || isa<StoreInst>(I)) && mayUsePostIncMode(...)
> ```
>
> Just trying my best to reuse existing code :)
It looks I can't find an easy way to reuse `mayUsePostIncMode`. It need the paramter SCEV that I can't find here.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138636/new/
https://reviews.llvm.org/D138636
More information about the llvm-commits
mailing list