[PATCH] D55420: SROA: move AATags member into base OpSplitter class. NFC.

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 7 02:54:51 PST 2018


t.p.northover created this revision.
t.p.northover added a reviewer: chandlerc.
Herald added subscribers: hiraditya, mcrosier.

Split out from https://reviews.llvm.org/D54743.

The member was duplicated in all users of the class so it makes sense to live there. Additionally, incoming alignment handling makes even more sense in the base class and makes added consistency an argument.


Repository:
  rL LLVM

https://reviews.llvm.org/D55420

Files:
  llvm/lib/Transforms/Scalar/SROA.cpp


Index: llvm/lib/Transforms/Scalar/SROA.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/SROA.cpp
+++ llvm/lib/Transforms/Scalar/SROA.cpp
@@ -3208,10 +3208,14 @@
     /// split operations.
     Value *Ptr;
 
+    /// TBAA information to attach to the new op.
+    AAMDNodes AATags;
+
     /// Initialize the splitter with an insertion point, Ptr and start with a
     /// single zero GEP index.
-    OpSplitter(Instruction *InsertionPoint, Value *Ptr)
-        : IRB(InsertionPoint), GEPIndices(1, IRB.getInt32(0)), Ptr(Ptr) {}
+    OpSplitter(Instruction *InsertionPoint, Value *Ptr, AAMDNodes AATags)
+        : IRB(InsertionPoint), GEPIndices(1, IRB.getInt32(0)), Ptr(Ptr),
+          AATags(AATags) {}
 
   public:
     /// Generic recursive split emission routine.
@@ -3266,10 +3270,8 @@
   };
 
   struct LoadOpSplitter : public OpSplitter<LoadOpSplitter> {
-    AAMDNodes AATags;
-
     LoadOpSplitter(Instruction *InsertionPoint, Value *Ptr, AAMDNodes AATags)
-        : OpSplitter<LoadOpSplitter>(InsertionPoint, Ptr), AATags(AATags) {}
+        : OpSplitter<LoadOpSplitter>(InsertionPoint, Ptr, AATags) {}
 
     /// Emit a leaf load of a single value. This is called at the leaves of the
     /// recursive emission to actually load values.
@@ -3305,8 +3307,7 @@
 
   struct StoreOpSplitter : public OpSplitter<StoreOpSplitter> {
     StoreOpSplitter(Instruction *InsertionPoint, Value *Ptr, AAMDNodes AATags)
-        : OpSplitter<StoreOpSplitter>(InsertionPoint, Ptr), AATags(AATags) {}
-    AAMDNodes AATags;
+        : OpSplitter<StoreOpSplitter>(InsertionPoint, Ptr, AATags) {}
 
     /// Emit a leaf store of a single value. This is called at the leaves of the
     /// recursive emission to actually produce stores.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55420.177156.patch
Type: text/x-patch
Size: 1787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181207/f07f0b4a/attachment.bin>


More information about the llvm-commits mailing list