llvm-project/llvm/test/Transforms/Attributor
Phoebe Wang 7c04454227 [ArgPromotion][Attributor] Update min-legal-vector-width when do promotion
X86 codegen uses function attribute `min-legal-vector-width` to select the proper ABI. The intention of the attribute is to reflect user's requirement when they passing or returning vector arguments. So Clang front-end will iterate the vector arguments and set `min-legal-vector-width` to the width of the maximum for both caller and callee.

It is assumed any middle end optimizations won't care of the attribute expect inlining and argument promotion.
- For inlining, we will propagate the attribute of inlined functions because the inlining functions become the newer caller.
- For argument promotion, we check the `min-legal-vector-width` of the caller and callee and refuse to promote when they don't match.

The problem comes from the optimizations' combination, as shown by https://godbolt.org/z/zo3hba8xW. The caller `foo` has two callees `bar` and `baz`. When doing argument promotion, both `foo` and `bar` has the same `min-legal-vector-width`. So the argument was promoted to vector. Then the inlining inlines `baz` to `foo` and updates `min-legal-vector-width`, which results in ABI mismatch between `foo` and `bar`.

This patch fixes the problem by expanding the concept of `min-legal-vector-width` to indicator of functions arguments. That says, any passes touch functions arguments have to set `min-legal-vector-width` to the value reflects the width of vector arguments. It makes sense to me because any arguments modifications are ABI related and should response for the ABI compatibility.

Differential Revision: https://reviews.llvm.org/D123284
2022-05-02 14:13:05 +08:00
..
ArgumentPromotion [ArgPromotion][Attributor] Update min-legal-vector-width when do promotion 2022-05-02 14:13:05 +08:00
IPConstantProp [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
reduced [Attributor] Introduce the concept of query AAs 2022-02-01 01:40:44 -06:00
align.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
allow_list.ll Extend the `uwtable` attribute with unwind table kind 2022-02-14 14:35:02 +00:00
alwaysinline.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
assumes_info.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
callbacks.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
callgraph.ll Attributor: Fix crash on undef in !callees 2021-09-14 19:49:34 -04:00
cb_liveness_disabled.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
cb_liveness_enabled.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
cb_range_disabled.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
cb_range_enabled.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
cgscc_bugs.ll [Attributor][FIX] Liveness handling in the isAssumedDead helpers 2022-02-01 01:18:52 -06:00
chain.ll
depgraph.ll [Attributor][NFC] Rename AAPotentialValues to AAPotentialConstantValues 2022-04-15 14:56:09 -05:00
dereferenceable-1.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
dereferenceable-2-inseltpoison.ll [Attributor] Introduce the concept of query AAs 2022-02-01 01:40:44 -06:00
dereferenceable-2.ll [Attributor] Introduce the concept of query AAs 2022-02-01 01:40:44 -06:00
heap_to_stack.ll [Attributor] Introduce AAInstanceInfo 2022-04-05 23:07:13 -05:00
heap_to_stack_gpu.ll [Attributor] Introduce AAInstanceInfo 2022-04-05 23:07:13 -05:00
internal-noalias.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
internalize.ll [Attributor] Introduce the concept of query AAs 2022-02-01 01:40:44 -06:00
lit.local.cfg
liveness.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
liveness_chains.ll [Attributor][FIX] Reachability needs to account for readonly callees 2022-02-10 13:52:24 -06:00
lowerheap.ll [Attributor] Introduce the concept of query AAs 2022-02-01 01:40:44 -06:00
lvi-after-jumpthreading.ll Reapply "[Intrinsics] Add `nocallback` to the default intrinsic attributes" 2022-03-25 09:36:50 -05:00
lvi-for-ashr.ll [Attributor] Avoid replacing return operands twice 2022-03-11 21:55:19 -06:00
memory_locations.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
misc.ll [Attributor] Introduce the concept of query AAs 2022-02-01 01:40:44 -06:00
misc_crash.ll [Attributor] Use AAFunctionReachability to determine AANoRecurse 2022-02-01 01:40:44 -06:00
new_attributes.ll
noalias.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
nocapture-1.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
nocapture-2.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
nodelete.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
nofree.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
nonnull.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
norecurse.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
noreturn.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
noreturn_async.ll [Attributor] Make interprocedural value explicit in genericValueTraversal 2022-02-01 01:40:44 -06:00
noreturn_sync.ll [Attributor][FIX] Liveness handling in the isAssumedDead helpers 2022-02-01 01:18:52 -06:00
nosync.ll Reapply "[Intrinsics] Add `nocallback` to the default intrinsic attributes" 2022-03-25 09:36:50 -05:00
noundef.ll [Attributor] Cleanup manifest and liveness for CGSCC passes 2022-03-11 16:46:02 -06:00
nounwind.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
openmp_parallel.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
potential.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
range.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
reachability.ll [Attributor][OpenMP] Add assumption for non-call assembly instructions 2022-03-28 20:57:52 -05:00
read_write_returned_arguments_scc.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
readattrs.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
returned.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
undefined_behavior.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
value-simplify-assume.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
value-simplify-gpu.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
value-simplify-instances.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
value-simplify-pointer-info.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
value-simplify.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
willreturn.ll [Attributor] CGSCC pass should not recompute results outside the SCC (reapply) 2022-04-17 12:48:49 -05:00
wrapper.ll [Attributor] Introduce the concept of query AAs 2022-02-01 01:40:44 -06:00