[PATCH] D102367: [LowerConstantIntrinsics] only accept ConstantData other than UndefValue as constant

Richard Smith - zygoloid via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 12 15:13:51 PDT 2021


rsmith added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp:53-54
+    WorkList.pop_back();
+    if (isa<ConstantData>(V) && !isa<UndefValue>(V))
+      return ConstantInt::getTrue(II->getType());
+    if (auto *CA = dyn_cast<ConstantAggregate>(V))
----------------
This looks backwards to me: I think we should only return `true` if all values in the worklist are suitable constants, not if any of them is.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102367



More information about the llvm-commits mailing list