[PATCH] D76838: [LV][LoopInfo] Transform counting-down loops to counting-up loop

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 3 01:02:31 PDT 2020


samparker added inline comments.


================
Comment at: llvm/lib/Analysis/LoopInfo.cpp:290
+  // Modify the Phi node with the new start value, i.e. 1.
+  IndVar->removeIncomingValue(Preheader);
+  IndVar->addIncoming(llvm::ConstantInt::get(IndOp->getType(), 1),
----------------
SjoerdMeijer wrote:
> samparker wrote:
> > I think just using setIncoming will be fine.
> That's what I wanted, but if I haven't overlooked anything, that requires an index, which means I need to do find the index first, then do setIncoming, and then I might as well remove it and add the updated one. 
Ah yes, sorry, its called setIncomingValueForBlock.


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

https://reviews.llvm.org/D76838





More information about the llvm-commits mailing list