[PATCH] D149132: [LICM] Reassociate & hoist add expressions

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 22:08:36 PDT 2023


mkazantsev added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:2590
+    return false;
+  const SCEV *RHSS = SE.getSCEV(RHS);
+  const SCEV *InvariantOpS = SE.getNegativeSCEV(SE.getSCEV(InvariantOp));
----------------
anna wrote:
> Don't we need to check for `isa<SCEVCouldNotCompute>(RHSS)` here and below for `InvariantOp` before getting NegativeSCEV?
No, value's SCEV is never `SCEVCouldNotCompute`. You can only get `SCEVCouldNotCompute` when computing some loop exit count, for example.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149132/new/

https://reviews.llvm.org/D149132



More information about the llvm-commits mailing list