diff options
author | David Sherwood <david.sherwood@arm.com> | 2021-11-08 12:02:21 +0000 |
---|---|---|
committer | David Sherwood <david.sherwood@arm.com> | 2021-11-10 09:42:58 +0000 |
commit | 2a48b6993a973e0ab2331e8c11dbd6e6100e2cfe (patch) | |
tree | 9fb0f9df6d8cfbc6554175f58c263ae69a3bdce5 /clang/lib/CodeGen/ModuleBuilder.cpp | |
parent | be98b20b9de7eea8aca0cd0d0d4746c3e360a3c8 (diff) | |
download | llvm-2a48b6993a973e0ab2331e8c11dbd6e6100e2cfe.zip llvm-2a48b6993a973e0ab2331e8c11dbd6e6100e2cfe.tar.gz llvm-2a48b6993a973e0ab2331e8c11dbd6e6100e2cfe.tar.bz2 |
[IR] In ConstantFoldShuffleVectorInstruction use zeroinitializer for splats of 0
When creating a splat of 0 for scalable vectors we tend to create them
with using a combination of shufflevector and insertelement, i.e.
shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 0, i32 0),
<vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
However, for the case of a zero splat we can actually just replace the
above with zeroinitializer instead. This makes the IR a lot simpler and
easier to read. I have changed ConstantFoldShuffleVectorInstruction to
use zeroinitializer when creating a splat of integer 0 or FP +0.0 values.
Differential Revision: https://reviews.llvm.org/D113394
Diffstat (limited to 'clang/lib/CodeGen/ModuleBuilder.cpp')
0 files changed, 0 insertions, 0 deletions