[PATCH] D22942: [SCEV] Fix runtime error caused by ValueOffsetPair

Wei Mi via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 23:33:08 PDT 2016


wmi added inline comments.

================
Comment at: include/llvm/Analysis/ScalarEvolutionExpander.h:283
@@ +282,3 @@
+    /// into the IR.
+    Value *findExistingExpansion(const SCEV *S, const Instruction *At, Loop *L,
+                                 bool OnlyCheckIsNull = true);
----------------
sanjoy wrote:
> Hi Wei,
> 
> I'm not sure this is the best interface -- it still is too easy to make mistakes.  I think there should be two entry points here (which can share code as appropriate):
> 
>  - `Value *getExactExistingExpansion` : if this returns non-null, then we know that the return value is the exact expansion.  We'll use this in IndVarSimplify (and potentially other places that don't want to generate additional code).
> 
>  - `Optional<ValueOffsetPair> getRelatedExistingExpansion`: if this returns non- `None`, then we know we can codegen the `ValueOffsetPair` into a suitable expansion.
> 
> The first can be implemented in terms of the latter.
That is a good suggestion. Thanks.


Repository:
  rL LLVM

https://reviews.llvm.org/D22942





More information about the llvm-commits mailing list