aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
diff options
context:
space:
mode:
authorPaul Walker <paul.walker@arm.com>2024-02-22 14:07:16 +0000
committerGitHub <noreply@github.com>2024-02-22 14:07:16 +0000
commitcbb24e139d0753d755d17fbe6bfac48ab44d0721 (patch)
tree3e4f75895dd6b9520ec68b53d0591d51203f454e /llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
parent5b8e5604c297aa8fd09bf641d12d0a663e0ea801 (diff)
downloadllvm-cbb24e139d0753d755d17fbe6bfac48ab44d0721.zip
llvm-cbb24e139d0753d755d17fbe6bfac48ab44d0721.tar.gz
llvm-cbb24e139d0753d755d17fbe6bfac48ab44d0721.tar.bz2
[LLVM][IR] Add native vector support to ConstantInt & ConstantFP. (#74502)
NOTE: For brevity the following talks about ConstantInt but everything extends to cover ConstantFP as well. Whilst ConstantInt::get() supports the creation of vectors whereby each lane has the same value, it achieves this via other constants: * ConstantVector for fixed-length vectors * ConstantExprs for scalable vectors However, ConstantExprs are being deprecated and ConstantVector is not space efficient for larger vector types. By extending ConstantInt we can represent vector splats by only storing the underlying scalar value. More specifically: * ConstantInt gains an ElementCount variant of get(). * LLVMContext is extended to map <EC,APInt>->ConstantInt. * BitcodeReader/Writer support is extended to allow vector types. Whilst this patch adds the base support, more work is required before it's production ready. For example, there's likely to be many places where isa<ConstantInt> assumes a scalar type. Accordingly the default behaviour of ConstantInt::get() remains unchanged but a set of flags are added to allow wider testing and thus help with the migration: --use-constant-int-for-fixed-length-splat --use-constant-fp-for-fixed-length-splat --use-constant-int-for-scalable-splat --use-constant-fp-for-scalable-splat NOTE: No change is required to the bitcode format because types and values are handled separately. NOTE: For similar reasons as above, code generation doesn't work out-the-box.
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp')
0 files changed, 0 insertions, 0 deletions