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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 17:38:00 PDT 2020


efriedma added inline comments.


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


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:4620
+  if (Op0Const && Op1Const)
+    return ConstantExpr::getShuffleVector(Op0Const, Op1Const, Mask);
+
----------------
This is redundant, I think?


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