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

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 09:29:41 PDT 2023


anna added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:2576
+
+  // LHS itsels if a invariant, try to represent it in the form:
+  // "VariantOp + InvariantOp". If it it possible, then we can reassociate.
----------------
Nit: LHS itself is an invariant. 


================
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));
----------------
Don't we need to check for `isa<SCEVCouldNotCompute>(RHSS)` here and below for `InvariantOp` before getting NegativeSCEV?


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

https://reviews.llvm.org/D149132



More information about the llvm-commits mailing list