[Attributor][FIX] Check AA preconditions
authorJohannes Doerfert <johannes@jdoerfert.de>
Thu, 29 Jun 2023 17:22:04 +0000 (10:22 -0700)
committerJohannes Doerfert <johannes@jdoerfert.de>
Thu, 29 Jun 2023 19:32:45 +0000 (12:32 -0700)
commit1221526681b73c3e99c6e41b5b1cb99ce4b52c69
treec9ac3d1aa7b512cdd73be5cd9846e589ece54933
parentde88628ab92695a737bb75dbefb1b652d602f9e2
[Attributor][FIX] Check AA preconditions

AAs often have preconditions, e.g., that the associated type is a
pointer type. If these do not hold, we do not need to bother creating
the AA. Best case, we invalidate it right away, worst case, we crash or
do something wrong (as happend in the issues below).

Fixes: https://github.com/llvm/llvm-project/issues/63553
Fixes: https://github.com/llvm/llvm-project/issues/63597
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/test/Transforms/Attributor/align.ll
llvm/test/Transforms/Attributor/liveness.ll