[PATCH] D123413: [IR] Allow constant folding (insertelement <vscale x 2 x i32> zeroinitializer, i32 0, i32 i32 0.
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 16 07:39:56 PDT 2022
reames added inline comments.
================
Comment at: llvm/lib/IR/ConstantFold.cpp:687
+ // Inserting null into all zeros is still all zeros.
+ // TODO: This is true for undef and poison splats too.
+ if (isa<ConstantAggregateZero>(Val) && Elt->isNullValue())
----------------
I believe this should hold for any insertion of a constant into a splat of the same value. Poison/Undef/Zero are all just special cases of that.
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