[Attributor] Ignore read accesses to constant memory
authorJohannes Doerfert <johannes@jdoerfert.de>
Wed, 9 Sep 2020 05:41:46 +0000 (00:41 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Wed, 7 Oct 2020 00:31:07 +0000 (19:31 -0500)
commitc4cfe7a43512c8fadb2aa207f6d914858e2cc50e
tree0e661e6e58cd0b2ae8ce2924883d2748e741a5c0
parent3f540c05dfe90f5c0378614e3a4ada06b967227e
[Attributor] Ignore read accesses to constant memory

The old function attribute deduction pass ignores reads of constant
memory and we need to copy this behavior to replace the pass completely.
First step are constant globals. TBAA can also describe constant
accesses and there are other possibilities. We might want to consider
asking the alias analyses that are available but for now this is simpler
and cheaper.
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/Attributor/ArgumentPromotion/aggregate-promote.ll
llvm/test/Transforms/Attributor/ArgumentPromotion/invalidation.ll
llvm/test/Transforms/Attributor/readattrs.ll