summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorJohannes Doerfert <johannes@jdoerfert.de>2019-12-31 00:57:00 -0600
committerJohannes Doerfert <johannes@jdoerfert.de>2019-12-31 01:33:21 -0600
commit28880198718b51a8d590d6e8194f2932683bdd54 (patch)
tree38e901bbdfa9e0a4611fdf6c68236d103bce8228 /llvm/lib/Transforms/IPO
parent23a6ae2b0624278646929d5cbed360f79be505ac (diff)
downloadbcm5719-llvm-28880198718b51a8d590d6e8194f2932683bdd54.tar.gz
bcm5719-llvm-28880198718b51a8d590d6e8194f2932683bdd54.zip
[Attributor] Annotate the memory behavior of call site arguments
Especially for callbacks, annotating the call site arguments is important. Doing so exposed a too strong dependence of AAMemoryBehavior on AANoCapture since we handle the case of potentially captured pointers explicitly. The changes to the tests are all mechanical.
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/Attributor.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index 0fe2cdc00a4..693bf7760c7 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -4933,7 +4933,8 @@ ChangeStatus AAMemoryBehaviorFloating::updateImpl(Attributor &A) {
// it is, any information derived would be irrelevant anyway as we cannot
// check the potential aliases introduced by the capture. However, no need
// to fall back to anythign less optimistic than the function state.
- const auto &ArgNoCaptureAA = A.getAAFor<AANoCapture>(*this, IRP);
+ const auto &ArgNoCaptureAA = A.getAAFor<AANoCapture>(
+ *this, IRP, /* TrackDependence */ true, DepClassTy::OPTIONAL);
if (!ArgNoCaptureAA.isAssumedNoCaptureMaybeReturned()) {
S.intersectAssumedBits(FnMemAssumedState);
return ChangeStatus::CHANGED;
@@ -5822,7 +5823,7 @@ void Attributor::identifyDefaultAbstractAttributes(Function &F) {
getOrCreateAAFor<AAIsDead>(CSRetPos);
}
- for (int i = 0, e = Callee->arg_size(); i < e; i++) {
+ for (int i = 0, e = CS.getNumArgOperands(); i < e; i++) {
IRPosition CSArgPos = IRPosition::callsite_argument(CS, i);
@@ -5847,6 +5848,10 @@ void Attributor::identifyDefaultAbstractAttributes(Function &F) {
// Call site argument attribute "align".
getOrCreateAAFor<AAAlign>(CSArgPos);
+ // Call site argument attribute
+ // "readnone/readonly/writeonly/..."
+ getOrCreateAAFor<AAMemoryBehavior>(CSArgPos);
+
// Call site argument attribute "nofree".
getOrCreateAAFor<AANoFree>(CSArgPos);
}
OpenPOWER on IntegriCloud