[PATCH] D85865: [ConstProp] Handle insertelement constants

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 10:01:18 PDT 2020


aeubanks added a comment.

In D85865#2214496 <https://reviews.llvm.org/D85865#2214496>, @efriedma wrote:

> 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().

Done.



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


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