aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorDavid Sherwood <david.sherwood@arm.com>2024-12-04 10:26:51 +0000
committerGitHub <noreply@github.com>2024-12-04 10:26:51 +0000
commit4675db5f394ebadd8a56bb17e2344da5c7779a68 (patch)
tree9cf52cfd103050274240e414a446705c1de9c3ce /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent4b5e7fa4de54e00df007ae5e2675393fd046aa59 (diff)
downloadllvm-4675db5f394ebadd8a56bb17e2344da5c7779a68.zip
llvm-4675db5f394ebadd8a56bb17e2344da5c7779a68.tar.gz
llvm-4675db5f394ebadd8a56bb17e2344da5c7779a68.tar.bz2
[DAGCombiner] Add support for scalarising extracts of a vector setcc (#117566)
For IR like this: %icmp = icmp ult <4 x i32> %a, splat (i32 5) %res = extractelement <4 x i1> %icmp, i32 1 where there is only one use of %icmp we can take a similar approach to what we already do for binary ops such add, sub, etc. and convert this into %ext = extractelement <4 x i32> %a, i32 1 %res = icmp ult i32 %ext, 5 For AArch64 targets at least the scalar boolean result will almost certainly need to be in a GPR anyway, since it will probably be used by branches for control flow. I've tried to reuse existing code in scalarizeExtractedBinop to also work for setcc. NOTE: The optimisations don't apply for tests such as extract_icmp_v4i32_splat_rhs in the file CodeGen/AArch64/extract-vector-cmp.ll because scalarizeExtractedBinOp only works if one of the input operands is a constant.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions