[PATCH] D123413: [IR] Allow constant folding (insertelement <vscale x 2 x i32> zeroinitializer, i32 0, i32 i32 0.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 8 12:17:24 PDT 2022


nikic added inline comments.


================
Comment at: llvm/lib/IR/ConstantFold.cpp:691
+  if (isa<ConstantAggregateZero>(Val) && Elt->isNullValue())
+    return Val;
+
----------------
This could go before the CIdx check. Also, this holds fold any splat Val (e.g. UndefValue or PoisonValue), not just zero.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123413



More information about the llvm-commits mailing list