[PATCH] D85946: [InstSimplify] Simplify to vector constants when possible

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 10:14:38 PDT 2020


aeubanks added inline comments.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:4305
+  if (VecC && ValC && IdxC) {
+    if (auto *Res = ConstantFoldInsertElementInstruction(VecC, ValC, IdxC))
+      return Res;
----------------
efriedma wrote:
> ConstantExpr::getInsertElement calls ConstantFoldInsertElementInstruction in its implementation.
Fixed.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:4620
+  if (Op0Const && Op1Const)
+    return ConstantExpr::getShuffleVector(Op0Const, Op1Const, Mask);
+
----------------
efriedma wrote:
> This is redundant, I think?
What do you mean? Removing this makes the newly added `insertelement_shufflevector_inline_to_ret()` fail.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85946



More information about the llvm-commits mailing list