[PATCH] D33543: Re-enable "[SCEV] Do not fold dominated SCEVUnknown into AddRecExpr start"
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 25 20:10:36 PDT 2017
mkazantsev added inline comments.
================
Comment at: lib/Analysis/ScalarEvolution.cpp:2209
+ switch (static_cast<SCEVTypes>(S->getSCEVType())) {
+ case scConstant:
+ return false;
----------------
sanjoy wrote:
> In a later change, maybe you can change this code to just do:
>
> ```
> if (auto *SU = dyn_cast<SCEVUnknown>(S))
> return checkUnknown(...);
> return true;
> ```
>
> (there should be no need to return false on constants -- they have no operands and thus nothing to follow)
I keep this swich intentionally. If a new type o SCEV ever appears, we will have a warning here. Addressing this warning should motivate the author of new SCEV to pay attention to this situation and process this new node properly.
https://reviews.llvm.org/D33543
More information about the llvm-commits
mailing list