[PATCH] D119373: [flang] Make folding of LEN less aggressive

Peter Klausler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 9 14:19:25 PST 2022


klausler added inline comments.


================
Comment at: flang/lib/Evaluate/fold-integer.cpp:680
             if (auto len{kx.LEN()}) {
-              return Fold(context, ConvertToType<T>(*std::move(len)));
+              if (IsConstantExpr(len)) {
+                return Fold(context, ConvertToType<T>(*std::move(len)));
----------------
IsConstantExpr() is too strict of a test; IsScopeInvariantExpr() would be better.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119373



More information about the llvm-commits mailing list