[PATCH] D47874: [SCEVExpander] Ignore dbg info when finding insertion point.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 7 04:37:04 PDT 2018


fhahn created this revision.
fhahn added reviewers: vsk, aprantl, sanjoy.

This avoids creating unnecessary casts if the IP used to be a dbg info
intrinsic. Fixes PR37727.


https://reviews.llvm.org/D47874

Files:
  lib/Analysis/ScalarEvolutionExpander.cpp


Index: lib/Analysis/ScalarEvolutionExpander.cpp
===================================================================
--- lib/Analysis/ScalarEvolutionExpander.cpp
+++ lib/Analysis/ScalarEvolutionExpander.cpp
@@ -92,7 +92,7 @@
   if (auto *II = dyn_cast<InvokeInst>(I))
     IP = II->getNormalDest()->begin();
 
-  while (isa<PHINode>(IP))
+  while (isa<PHINode>(IP) || isa<DbgInfoIntrinsic>(IP))
     ++IP;
 
   if (isa<FuncletPadInst>(IP) || isa<LandingPadInst>(IP)) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47874.150297.patch
Type: text/x-patch
Size: 468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180607/f89a2ff0/attachment.bin>


More information about the llvm-commits mailing list