[PATCH] D70985: [InstCombine][SVE] Skip scalable vectors in ConstantFoldInsertElementInstruction.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 15:51:40 PST 2019


efriedma added a comment.

instcombine probably isn't the best place to stick a test for ConstantFold.cpp.  Not sure where we're sticking tests for ConstantFold.cpp these days, though. Maybe test/Analysis/ConstantFolding/ is appropriate. (The directory name is actually referring to different code, but it's closer.)



================
Comment at: llvm/lib/IR/ConstantFold.cpp:840
+  if (ValTy->isScalable())
+    return nullptr;
+
----------------
We could handle the special case of inserting zero into a zero vector.  Not important, though.


================
Comment at: llvm/test/Transforms/InstCombine/insertelement.ll:71
+;
+  %i = insertelement <vscale x 4 x i32> undef, i32 1, i32 %val
+  ret <vscale x 4 x i32> %i
----------------
Tests involving non-constant operands don't really seem related.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70985





More information about the llvm-commits mailing list