[Attributor][FIX] Improve care when dealing with liveness
authorJohannes Doerfert <johannes@jdoerfert.de>
Thu, 12 Jan 2023 01:19:34 +0000 (17:19 -0800)
committerJohannes Doerfert <johannes@jdoerfert.de>
Thu, 12 Jan 2023 07:49:10 +0000 (23:49 -0800)
commitd7be8227a84f95071911b60d32d751e8780dde12
treea8766f317da3922517098f0006a3960d4de02bf3
parent96c335e2ccf25091f55561bccc7f2f1a1a5f38a5
[Attributor][FIX] Improve care when dealing with liveness

This patch adds two checks that have in experiments caused issues. One
was an oversight that allowed new AAs during cleanup to be optimistic.
The other treated functions as functions even if they were used as
values, e.g., in a cast instruction. In such cases we might have assumed
the value is dead if the function is not entered, which isn't true.

The new test functions don't expose a bug but I kept them around.
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll
llvm/test/Transforms/Attributor/align.ll
llvm/test/Transforms/Attributor/value-simplify.ll