[PATCH] D38415: [SimplifyIndVar] Replace IVUsers with loop invariant if possible

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 9 10:43:30 PDT 2017


hfinkel added inline comments.


================
Comment at: lib/Transforms/Utils/SimplifyIndVar.cpp:562
 
-  Constant *V = C->getValue();
-  // The SCEV will have a different type than the instruction if the instruction
-  // has a pointer type. Skip the replacement
-  // TODO: Replace ConstantInt Zero by ConstantPointerNull
-  if (V->getType() != I->getType())
+  // Do not generate something ridiculous even if S is loop invariant
+  if (Rewriter.isHighCostExpansion(S, UserL, I))
----------------
End comments with a period (here and also below).


Repository:
  rL LLVM

https://reviews.llvm.org/D38415





More information about the llvm-commits mailing list