[PATCH] D85865: [ConstProp] Handle insertelement constants

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 17:36:06 PDT 2020


efriedma added a comment.

I think I'd prefer to keep this code in ConstantFoldExtractElementInstruction, rather than extend getAggregateElement() this way; I think it's unintuitive to be doing constant folding in getAggregateElement().



================
Comment at: llvm/lib/IR/Constants.cpp:421
+        if (auto *IEValue = dyn_cast<Constant>(IE->getOperand(1)))
+          return IEValue;
+      }
----------------
Can we also fold in the case where the indexes are known not-equal?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85865



More information about the llvm-commits mailing list