Skip to content

Commit 46829dd

Browse files
author
Greg Roth
committed
Respond to feedback
Remove some unneeded parts of IR tests. Add some back. I discovered that the pauseresume line is at least sometimes needed to construct the module with the shader model information. I fear some of the tests were passing before becuase they expected no changes, but were operating in non-6.9 mode. So they passed, but for the wrong reason. Remove unused DM param to matrixbitcastlowerpass lower matrix call. reword confusing dynindexingvectortoarray comment
1 parent 8dc2a3e commit 46829dd

7 files changed

Lines changed: 14 additions & 31 deletions

File tree

lib/HLSL/HLMatrixBitcastLowerPass.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ class MatrixBitcastLowerPass : public FunctionPass {
116116

117117
// Lower matrix first.
118118
for (BitCastInst *BCI : matCastSet) {
119-
lowerMatrix(DM, BCI, BCI->getOperand(0));
119+
lowerMatrix(BCI, BCI->getOperand(0));
120120
}
121121
return bUpdated;
122122
}
123123

124124
private:
125-
void lowerMatrix(DxilModule &DM, Instruction *M, Value *A);
125+
void lowerMatrix(Instruction *M, Value *A);
126126
bool hasCallUser(Instruction *M);
127127
};
128128

@@ -183,8 +183,7 @@ Value *CreateEltGEP(Value *A, unsigned i, Value *zeroIdx,
183183
}
184184
} // namespace
185185

186-
void MatrixBitcastLowerPass::lowerMatrix(DxilModule &DM, Instruction *M,
187-
Value *A) {
186+
void MatrixBitcastLowerPass::lowerMatrix(Instruction *M, Value *A) {
188187
for (auto it = M->user_begin(); it != M->user_end();) {
189188
User *U = *(it++);
190189
if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) {
@@ -203,14 +202,14 @@ void MatrixBitcastLowerPass::lowerMatrix(DxilModule &DM, Instruction *M,
203202
idxList.back() = Builder.CreateMul(idxList.back(), MatSize);
204203
}
205204
Value *NewGEP = Builder.CreateGEP(A, idxList);
206-
lowerMatrix(DM, GEP, NewGEP);
205+
lowerMatrix(GEP, NewGEP);
207206
DXASSERT(GEP->user_empty(), "else lower matrix fail");
208207
GEP->eraseFromParent();
209208
} else {
210209
DXASSERT(0, "invalid GEP for matrix");
211210
}
212211
} else if (BitCastInst *BCI = dyn_cast<BitCastInst>(U)) {
213-
lowerMatrix(DM, BCI, A);
212+
lowerMatrix(BCI, A);
214213
DXASSERT(BCI->user_empty(), "else lower matrix fail");
215214
BCI->eraseFromParent();
216215
} else if (LoadInst *LI = dyn_cast<LoadInst>(U)) {

lib/Transforms/Scalar/LowerTypePasses.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,11 @@ void DynamicIndexingVectorToArray::initialize(Module &M) {
216216
// - From standard compile before dxilgen.
217217
// - When linking, where dxmodule is available.
218218
// - In isolated dxopt, where the module will need to be created.
219-
// Since HL module can't be created when linking, check for that first.
219+
// When linking, we expect a dxil module and can't create an HL module,
220+
// so we try for the dxil module first.
220221
// Otherwise, either retrieve or generate the HL module.
221222
if (M.HasDxilModule()) {
222-
SupportsVectors = M.GetDxilModule().GetShaderModel()->IsSM69Plus();
223+
SupportsVectors = M.GetOrCreateDxilModule().GetShaderModel()->IsSM69Plus();
223224
} else {
224225
HLModule &HLM = M.GetOrCreateHLModule();
225226
SupportsVectors = HLM.GetShaderModel()->IsSM69Plus();

tools/clang/test/CodeGenDXIL/passes/longvec-alloca-gv-dynvec2array.ll

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ bb:
7474
%stloc1 = alloca <1 x float>, align 4
7575
%stloc2 = alloca <2 x float>, align 4
7676
%stlar2 = alloca [4 x <2 x float>], align 4
77-
store i32 %ix, i32* %tmp, align 4, !tbaa !22
77+
store i32 %ix, i32* %tmp, align 4
7878

7979
%tmp13 = load i32, i32* %tmp, align 4 ; line:53 col:7
8080
%tmp14 = icmp sgt i32 %tmp13, 0 ; line:53 col:10
@@ -265,6 +265,7 @@ bb76: ; preds = %bb17, %bb
265265

266266
attributes #0 = { nounwind }
267267

268+
!pauseresume = !{!1}
268269
!dx.version = !{!3}
269270
!dx.valver = !{!3}
270271
!dx.shaderModel = !{!4}
@@ -273,9 +274,7 @@ attributes #0 = { nounwind }
273274
!dx.fnprops = !{}
274275
!dx.options = !{!20, !21}
275276

276-
!0 = !{i32 2, !"Debug Info Version", i32 3}
277277
!1 = !{!"hlsl-hlemit", !"hlsl-hlensure"}
278-
!2 = !{!"dxc(private) 1.8.0.4845 (disable_disble_spirv, 2514104b9-dirty)"}
279278
!3 = !{i32 1, i32 9}
280279
!4 = !{!"lib", i32 6, i32 9}
281280
!5 = !{i32 0, %struct.VectRec1 undef, !6, %struct.VectRec2 undef, !8}
@@ -295,10 +294,3 @@ attributes #0 = { nounwind }
295294
!19 = !{null, !"", null, null, null}
296295
!20 = !{i32 64}
297296
!21 = !{i32 -1}
298-
!22 = !{!23, !23, i64 0}
299-
!23 = !{!"int", !24, i64 0}
300-
!24 = !{!"omnipotent char", !25, i64 0}
301-
!25 = !{!"Simple C/C++ TBAA"}
302-
!44 = !{!45, !45, i64 0}
303-
!45 = !{!"float", !24, i64 0}
304-
!148 = !{!24, !24, i64 0}

tools/clang/test/CodeGenDXIL/passes/longvec-alloca-gv-sroa.ll

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ bb:
8282
%stlorc1 = alloca %struct.VectRec1, align 4
8383
%stlorc2 = alloca %struct.VectRec2, align 4
8484

85-
store i32 %ix, i32* %tmp, align 4, !tbaa !25
85+
store i32 %ix, i32* %tmp, align 4
8686
%tmp13 = load i32, i32* %tmp, align 4 ; line:53 col:7
8787
%tmp14 = icmp sgt i32 %tmp13, 0 ; line:53 col:10
8888
%tmp15 = icmp ne i1 %tmp14, false ; line:53 col:10
@@ -286,6 +286,7 @@ bb86: ; preds = %bb17, %bb
286286

287287
attributes #0 = { nounwind }
288288

289+
!pauseresume = !{!1}
289290
!dx.version = !{!3}
290291
!dx.valver = !{!3}
291292
!dx.shaderModel = !{!4}
@@ -294,9 +295,7 @@ attributes #0 = { nounwind }
294295
!dx.fnprops = !{}
295296
!dx.options = !{!23, !24}
296297

297-
!0 = !{i32 2, !"Debug Info Version", i32 3}
298298
!1 = !{!"hlsl-hlemit", !"hlsl-hlensure"}
299-
!2 = !{!"dxc(private) 1.8.0.4845 (disable_disble_spirv, 2514104b9-dirty)"}
300299
!3 = !{i32 1, i32 9}
301300
!4 = !{!"lib", i32 6, i32 9}
302301
!5 = !{i32 0, %struct.VectRec1 undef, !6, %struct.VectRec2 undef, !8}
@@ -323,6 +322,3 @@ attributes #0 = { nounwind }
323322
!26 = !{!"int", !27, i64 0}
324323
!27 = !{!"omnipotent char", !28, i64 0}
325324
!28 = !{!"Simple C/C++ TBAA"}
326-
!47 = !{!48, !48, i64 0}
327-
!48 = !{!"float", !27, i64 0}
328-
!155 = !{!27, !27, i64 0}

tools/clang/test/CodeGenDXIL/passes/longvec-operators-scalarizer.ll

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,19 +655,15 @@ attributes #0 = { nounwind }
655655
attributes #1 = { nounwind readonly }
656656
attributes #2 = { nounwind readnone }
657657

658-
!llvm.module.flags = !{!0}
659658
!pauseresume = !{!1}
660-
!llvm.ident = !{!2}
661659
!dx.version = !{!3}
662660
!dx.valver = !{!3}
663661
!dx.shaderModel = !{!4}
664662
!dx.resources = !{!5}
665663
!dx.typeAnnotations = !{!9, !15}
666664
!dx.entryPoints = !{!35}
667665

668-
!0 = !{i32 2, !"Debug Info Version", i32 3}
669666
!1 = !{!"hlsl-dxilemit", !"hlsl-dxilload"}
670-
!2 = !{!"dxc(private) 1.8.0.4845 (disable_disble_spirv, 2514104b9-dirty)"}
671667
!3 = !{i32 1, i32 9}
672668
!4 = !{!"lib", i32 6, i32 9}
673669
!5 = !{null, !6, null, null}

tools/clang/test/CodeGenDXIL/passes/longvec-operators-vec1-scalarizer.ll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,16 +741,15 @@ attributes #0 = { nounwind }
741741
attributes #1 = { nounwind readnone }
742742
attributes #2 = { nounwind readonly }
743743

744+
!pauseresume = !{!1}
744745
!dx.version = !{!3}
745746
!dx.valver = !{!3}
746747
!dx.shaderModel = !{!4}
747748
!dx.resources = !{!5}
748749
!dx.typeAnnotations = !{!9, !15}
749750
!dx.entryPoints = !{!35}
750751

751-
!0 = !{i32 2, !"Debug Info Version", i32 3}
752752
!1 = !{!"hlsl-dxilemit", !"hlsl-dxilload"}
753-
!2 = !{!"dxc(private) 1.8.0.4807 (longvec_bab_ldst, 88cfe61c3-dirty)"}
754753
!3 = !{i32 1, i32 9}
755754
!4 = !{!"lib", i32 6, i32 9}
756755
!5 = !{null, !6, null, null}

tools/clang/test/HLSLFileCheck/passes/dxil/lower_type/vec_array_param.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ declare float @"\01?foo@@YAMY02V?$vector@M$02@@@Z"([3 x <3 x float>]*)
3131

3232
attributes #0 = { nounwind }
3333

34+
!pauseresume = !{!1}
3435
!dx.version = !{!3}
3536
!dx.valver = !{!4}
3637
!dx.shaderModel = !{!5}
@@ -39,7 +40,6 @@ attributes #0 = { nounwind }
3940
!dx.fnprops = !{}
4041
!dx.options = !{!13, !14}
4142

42-
!0 = !{i32 2, !"Debug Info Version", i32 3}
4343
!1 = !{!"hlsl-hlemit", !"hlsl-hlensure"}
4444
!3 = !{i32 1, i32 6}
4545
!4 = !{i32 1, i32 6}

0 commit comments

Comments
 (0)