[PATCH] D51404: [IndVars] Remove unreasonable checks in rewriteLoopExitValues

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 17 20:10:42 PDT 2018


mkazantsev added inline comments.


================
Comment at: lib/Transforms/Scalar/IndVarSimplify.cpp:616-631
+                for (auto *PB : UseInstr->users()) {
+                  unsigned PhiOpc = cast<Instruction>(PB)->getOpcode();
                   if (PhiOpc != Instruction::Call &&
                       PhiOpc != Instruction::Ret) {
                     HasSoftExternalUses = true;
                     break;
                   }
----------------
etherzhhb wrote:
> mkazantsev wrote:
> > etherzhhb wrote:
> > > The only suggestion is maybe we could extract this piece of code to a standalone function. 
> > > This can make the code easier to understand
> > It's done in the follow-up patch https://reviews.llvm.org/D51584. I'm merging them one by one just to make reviewers' life easier. :)
> Is there other patches between this and D51584? I saw some thing like "if (ExitValue->getSCEVType()>=scMulExpr) {" is gone (just out of curiosity :) )
Yes there is, https://reviews.llvm.org/D51581

You can use "Stack" tab in Revision Contensts section to see dependencies. :)

As for this check, it's removed in the last patch (I really have no idea why it was there).


https://reviews.llvm.org/D51404





More information about the llvm-commits mailing list