[Attributor] Use CFG reasoning to filter potentially interfering writes
authorJohannes Doerfert <johannes@jdoerfert.de>
Sat, 17 Jul 2021 06:54:43 +0000 (01:54 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Tue, 1 Feb 2022 07:18:51 +0000 (01:18 -0600)
commite140d5131928ee63df80667dc1acc12715043c16
treeb7b55e9e77a9c224444ba2dd9d2c6033deaf18b8
parent191fa419a64ea7bac4c100e5a71836c9f43084cd
[Attributor] Use CFG reasoning to filter potentially interfering writes

Since D104432 we can look through memory by analyzing all writes that
might interfere with a load. This patch provides some logic to exclude
writes that cannot interfere with a location, due to CFG reasoning.
We make sure to avoid multi-thread write-read situations properly while
we ignore writes that cannot reach a load or writes that will be
overwritten before the load is reached.

Differential Revision: https://reviews.llvm.org/D106397
13 files changed:
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll
llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll
llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll
llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll
llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll
llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll
llvm/test/Transforms/Attributor/heap_to_stack.ll
llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll
llvm/test/Transforms/Attributor/misc.ll
llvm/test/Transforms/Attributor/noalias.ll
llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll