[PATCH] D86271: Skip Alloca insts when finding insert point

Dangeti Tharun kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 02:20:43 PDT 2020


tdangeti created this revision.
tdangeti added reviewers: sunfish, venkataramanan.kumar.llvm, venur.
tdangeti added a project: LLVM.
Herald added subscribers: llvm-commits, hiraditya.
tdangeti requested review of this revision.

Verifier is complaining if the instructions are inserted b/w allocas.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86271

Files:
  llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp


Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -5157,9 +5157,11 @@
   // still being dominated by the input positions.
   BasicBlock::iterator IP = HoistInsertPosition(LowestIP, Inputs);
 
-  // Don't insert instructions before PHI nodes.
+  // Don't insert instructions before PHI nodes and Allocas.
   while (isa<PHINode>(IP)) ++IP;
 
+  while (isa<AllocaInst>(IP)) ++IP;
+
   // Ignore landingpad instructions.
   while (IP->isEHPad()) ++IP;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86271.286744.patch
Type: text/x-patch
Size: 636 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200820/b3637df4/attachment.bin>


More information about the llvm-commits mailing list