Skip to content

Commit f1de617

Browse files
author
Greg Roth
committed
clang-format
1 parent 248fe80 commit f1de617

3 files changed

Lines changed: 25 additions & 26 deletions

File tree

lib/HLSL/HLMatrixBitcastLowerPass.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,16 @@ Type *TryLowerMatTy(Type *Ty) {
7777

7878
class MatrixBitcastLowerPass : public FunctionPass {
7979
bool SupportsVectors = false;
80+
8081
public:
8182
static char ID; // Pass identification, replacement for typeid
8283
explicit MatrixBitcastLowerPass() : FunctionPass(ID) {}
8384

8485
StringRef getPassName() const override { return "Matrix Bitcast lower"; }
8586
bool runOnFunction(Function &F) override {
8687
if (F.getParent()->HasDxilModule())
87-
SupportsVectors = F.getParent()->GetDxilModule().GetShaderModel()->IsSM69Plus();
88+
SupportsVectors =
89+
F.getParent()->GetDxilModule().GetShaderModel()->IsSM69Plus();
8890
bool bUpdated = false;
8991
std::unordered_set<BitCastInst *> matCastSet;
9092
for (auto blkIt = F.begin(); blkIt != F.end(); ++blkIt) {

lib/Transforms/Scalar/ScalarReplAggregatesHLSL.cpp

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -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,
29232924
bool 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) {

lib/Transforms/Scalar/Scalarizer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,11 @@ bool Scalarizer::visitBitCastInst(BitCastInst &BCI) {
568568
if (!DstVT || !SrcVT)
569569
return false;
570570

571-
572571
unsigned DstNumElems = DstVT->getNumElements();
573572
unsigned SrcNumElems = SrcVT->getNumElements();
574573

575574
// HLSL Change Begin - allow > 1 vectors where supported.
576-
if (SupportsVectors && (DstNumElems > 1 || SrcNumElems > 1))
575+
if (SupportsVectors && (DstNumElems > 1 || SrcNumElems > 1))
577576
return false;
578577
// HLSL Change End - allow > 1 vectors where supported.
579578

0 commit comments

Comments
 (0)