aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDavid Sherwood <david.sherwood@arm.com>2020-09-09 14:03:07 +0100
committerDavid Sherwood <david.sherwood@arm.com>2020-09-23 08:43:05 +0100
commit59c4d5aad060927fa95b917c11aad4e310849a4b (patch)
tree352e8706865839e9622503d9eba848ad2334f756 /clang/lib/CodeGen/CodeGenModule.cpp
parent8d7fd73c3a8ce069cfe48dfcf949b4a59c05c673 (diff)
downloadllvm-59c4d5aad060927fa95b917c11aad4e310849a4b.zip
llvm-59c4d5aad060927fa95b917c11aad4e310849a4b.tar.gz
llvm-59c4d5aad060927fa95b917c11aad4e310849a4b.tar.bz2
[SVE] Fix InstCombinerImpl::PromoteCastOfAllocation for scalable vectors
In this patch I've fixed some warnings that arose from the implicit cast of TypeSize -> uint64_t. I tried writing a variety of different cases to show how this optimisation might work for scalable vectors and found: 1. The optimisation does not work for cases where the cast type is scalable and the allocated type is not. This because we need to know how many times the cast type fits into the allocated type. 2. If we pass all the various checks for the case when the allocated type is scalable and the cast type is not, then when creating the new alloca we have to take vscale into account. This leads to sub-optimal IR that is worse than the original IR. 3. For the remaining case when both the alloca and cast types are scalable it is hard to find examples where the optimisation would kick in, except for simple bitcasts, because we typically fail the ABI alignment checks. For now I've changed the code to bail out if only one of the alloca and cast types is scalable. This means we continue to support the existing cases where both types are fixed, and also the specific case when both types are scalable with the same size and alignment, for example a simple bitcast of an alloca to another type. I've added tests that show we don't attempt to promote the alloca, except for simple bitcasts: Transforms/InstCombine/AArch64/sve-cast-of-alloc.ll Differential revision: https://reviews.llvm.org/D87378
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions