[PATCH] D68852: [Attributor] Pointer privatization attribute (argument promotion)

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 09:04:21 PST 2019


efriedma added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:4697
+    } else {
+      ReplacementValues.push_back(new LoadInst(PrivType, Base, "", IP));
+    }
----------------
jdoerfert wrote:
> efriedma wrote:
> > No alignment set on loads?
> I'll add the alignment for the alloca below based on the alignment of the pointer it replaces. The loads and stores will be annotated by the next run of the Attributor automatically.
> 
> We can also consider not emitting it if we can prove it is not needed, though that will not always be the case and it will require an analysis we do not yet have (something like AAAccessTracker).
> 
> Finally, SROA should, in the good case, eliminate the alloca completely.
> The loads and stores will be annotated by the next run of the Attributor automatically.

The default alignment of a load is the alignment of the load's type, as computed by the datalayout.  This might be too high, depending on the pointer.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68852





More information about the llvm-commits mailing list