Skip to content

Commit 47d42f0

Browse files
author
Greg Roth
committed
simplify bitcast module retrieval
1 parent f1de617 commit 47d42f0

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lib/HLSL/HLMatrixBitcastLowerPass.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ class MatrixBitcastLowerPass : public FunctionPass {
8484

8585
StringRef getPassName() const override { return "Matrix Bitcast lower"; }
8686
bool runOnFunction(Function &F) override {
87-
if (F.getParent()->HasDxilModule())
88-
SupportsVectors =
89-
F.getParent()->GetDxilModule().GetShaderModel()->IsSM69Plus();
87+
DxilModule &DM = F.getParent()->GetOrCreateDxilModule();
88+
SupportsVectors = DM.GetShaderModel()->IsSM69Plus();
89+
9090
bool bUpdated = false;
9191
std::unordered_set<BitCastInst *> matCastSet;
9292
for (auto blkIt = F.begin(); blkIt != F.end(); ++blkIt) {
@@ -104,7 +104,6 @@ class MatrixBitcastLowerPass : public FunctionPass {
104104
}
105105
}
106106

107-
DxilModule &DM = F.getParent()->GetOrCreateDxilModule();
108107
// Remove bitcast which has CallInst user.
109108
if (DM.GetShaderModel()->IsLib()) {
110109
for (auto it = matCastSet.begin(); it != matCastSet.end();) {

0 commit comments

Comments
 (0)