@@ -81,17 +81,18 @@ class SROA_Helper {
8181 static bool DoScalarReplacement (Value *V, std::vector<Value *> &Elts,
8282 Type *&BrokenUpTy, uint64_t &NumInstances,
8383 IRBuilder<> &Builder, bool bFlatVector,
84- bool SupportsVectors,
85- bool hasPrecise, DxilTypeSystem &typeSys,
86- const DataLayout &DL,
84+ bool SupportsVectors, bool hasPrecise,
85+ DxilTypeSystem &typeSys, const DataLayout &DL,
8786 SmallVector<Value *, 32 > &DeadInsts,
8887 DominatorTree *DT);
8988
90- static bool
91- DoScalarReplacement (GlobalVariable *GV, std::vector<Value *> &Elts,
92- IRBuilder<> &Builder, bool bFlatVector, bool SupportsVectors, bool hasPrecise,
93- DxilTypeSystem &typeSys, const DataLayout &DL,
94- SmallVector<Value *, 32 > &DeadInsts, DominatorTree *DT);
89+ static bool DoScalarReplacement (GlobalVariable *GV,
90+ std::vector<Value *> &Elts,
91+ IRBuilder<> &Builder, bool bFlatVector,
92+ bool SupportsVectors, bool hasPrecise,
93+ DxilTypeSystem &typeSys, const DataLayout &DL,
94+ SmallVector<Value *, 32 > &DeadInsts,
95+ DominatorTree *DT);
9596 static unsigned GetEltAlign (unsigned ValueAlign, const DataLayout &DL,
9697 Type *EltTy, unsigned Offset);
9798 // Lower memcpy related to V.
@@ -1880,7 +1881,8 @@ bool SROAGlobalAndAllocas(HLModule &HLM, bool bHasDbgInfo) {
18801881 uint64_t NumInstances = 1 ;
18811882 bool SROAed = SROA_Helper::DoScalarReplacement (
18821883 AI, Elts, BrokenUpTy, NumInstances, Builder,
1883- /* bFlatVector*/ true , SupportsVectors, hasPrecise, typeSys, DL, DeadInsts, &DT);
1884+ /* bFlatVector*/ true , SupportsVectors, hasPrecise, typeSys, DL,
1885+ DeadInsts, &DT);
18841886
18851887 if (SROAed) {
18861888 Type *Ty = AI->getAllocatedType ();
@@ -1948,8 +1950,7 @@ bool SROAGlobalAndAllocas(HLModule &HLM, bool bHasDbgInfo) {
19481950 }
19491951
19501952 // Flatten Global vector if no dynamic vector indexing.
1951- bool bFlatVector =
1952- !hasDynamicVectorIndexing (GV);
1953+ bool bFlatVector = !hasDynamicVectorIndexing (GV);
19531954
19541955 if (bFlatVector) {
19551956 GVDbgOffset &dbgOffset = GVDbgOffsetMap[GV];
@@ -2923,8 +2924,8 @@ static ArrayType *CreateNestArrayTy(Type *FinalEltTy,
29232924bool SROA_Helper::DoScalarReplacement (Value *V, std::vector<Value *> &Elts,
29242925 Type *&BrokenUpTy, uint64_t &NumInstances,
29252926 IRBuilder<> &Builder, bool bFlatVector,
2926- bool SupportsVectors,
2927- bool hasPrecise, DxilTypeSystem &typeSys,
2927+ bool SupportsVectors, bool hasPrecise,
2928+ DxilTypeSystem &typeSys,
29282929 const DataLayout &DL,
29292930 SmallVector<Value *, 32 > &DeadInsts,
29302931 DominatorTree *DT) {
@@ -3122,14 +3123,11 @@ unsigned SROA_Helper::GetEltAlign(unsigned ValueAlign, const DataLayout &DL,
31223123
31233124// / DoScalarReplacement - Split V into AllocaInsts with Builder and save the new
31243125// / AllocaInsts into Elts. Then do SROA on V.
3125- bool SROA_Helper::DoScalarReplacement (GlobalVariable *GV,
3126- std::vector<Value *> &Elts,
3127- IRBuilder<> &Builder, bool bFlatVector,
3128- bool SupportsVectors,
3129- bool hasPrecise, DxilTypeSystem &typeSys,
3130- const DataLayout &DL,
3131- SmallVector<Value *, 32 > &DeadInsts,
3132- DominatorTree *DT) {
3126+ bool SROA_Helper::DoScalarReplacement (
3127+ GlobalVariable *GV, std::vector<Value *> &Elts, IRBuilder<> &Builder,
3128+ bool bFlatVector, bool SupportsVectors, bool hasPrecise,
3129+ DxilTypeSystem &typeSys, const DataLayout &DL,
3130+ SmallVector<Value *, 32 > &DeadInsts, DominatorTree *DT) {
31333131 DEBUG (dbgs () << " Found inst to SROA: " << *GV << ' \n ' );
31343132 Type *Ty = GV->getType ();
31353133 // Skip none pointer types.
@@ -5369,8 +5367,8 @@ void SROA_Parameter_HLSL::flattenArgument(
53695367 // DomTree isn't used by arguments
53705368 SROAed = SROA_Helper::DoScalarReplacement (
53715369 V, Elts, BrokenUpTy, NumInstances, Builder,
5372- /* bFlatVector*/ false , SupportsVectors, annotation.IsPrecise (), dxilTypeSys, DL,
5373- DeadInsts, /* DT*/ nullptr );
5370+ /* bFlatVector*/ false , SupportsVectors, annotation.IsPrecise (),
5371+ dxilTypeSys, DL, DeadInsts, /* DT*/ nullptr );
53745372 }
53755373
53765374 if (SROAed) {
0 commit comments