[PATCH] D72562: [Attributor][Fix] AAHeapToStack and AAIsDead connection

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 17 17:18:38 PST 2020


jdoerfert added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:2915
+      if (isMallocOrCallocLikeFn(I, TLI) || isFreeCall(I, TLI))
+        return ChangeStatus::CHANGED;
+
----------------
sstefan1 wrote:
> jdoerfert wrote:
> > Would it work the other way around, as well? Deleting them here not in H2S. If so it would remove the special case here and some code in H2S, right?
> I had this in mind, but I don't think it would work because `isAssumedSideEffectFree()` will be false.
I see. In that case, can you move the special logic into `isAssumedSideEffectFree` to cut down on the duplication and allow reuse later on?


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:3048
+        IsAssumedSideEffectFree = true;
+        return indicateOptimisticFixpoint();
+      }
----------------
This is assumed information, correct? If so, we cannot indicate a fixpoint and we need to record a dependence if we use the information.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:4920
+    if(IsMalloc && llvm::any_of(MallocCalls, IsI))
+      return true;
+
----------------
```
if(IsMalloc)
  return llvm::any_of(MallocCalls, IsI);
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72562/new/

https://reviews.llvm.org/D72562





More information about the llvm-commits mailing list