Skip to content

Commit 070ee36

Browse files
committed
address pr comments
1 parent c554589 commit 070ee36

File tree

5 files changed

+51
-47
lines changed

5 files changed

+51
-47
lines changed

llvm/lib/Target/DirectX/DirectXTargetMachine.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ class DirectXPassConfig : public TargetPassConfig {
8787
void addCodeGenPrepare() override {
8888
addPass(createDXILIntrinsicExpansionLegacyPass());
8989
ScalarizerPassOptions DxilScalarOptions;
90-
// The only non-default option we need to set is ScalarizeLoadStore.
9190
DxilScalarOptions.ScalarizeLoadStore = true;
9291
addPass(createScalarizerPass(DxilScalarOptions));
9392
addPass(createDXILOpLoweringLegacyPass());
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
; RUN: llc -mtriple=dxil-pc-shadermodel6.3-library -debug-pass=Structure < %s -o /dev/null 2>&1 | \
2+
; RUN: grep -v "Verify generated machine code" | FileCheck %s
3+
4+
; REQUIRES: asserts
5+
6+
; CHECK-LABEL: Pass Arguments:
7+
; CHECK-NEXT: Target Library Information
8+
; CHECK-NEXT: ModulePass Manager
9+
; CHECK-NEXT: DXIL Intrinsic Expansion
10+
; CHECK-NEXT: FunctionPass Manager
11+
; CHECK-NEXT: Dominator Tree Construction
12+
; CHECK-NEXT: Scalarize vector operations
13+
; CHECK-NEXT: DXIL Intrinsic Expansion
14+
; CHECK-NEXT: DXIL Resource analysis
15+
; CHECK-NEXT: DXIL Op Lowering
16+
; CHECK-NEXT: DXIL Finalize Linkage
17+
; CHECK-NEXT: DXIL Resource analysis
18+
; CHECK-NEXT: DXIL resource Information
19+
; CHECK-NEXT: DXIL Shader Flag Analysis
20+
; CHECK-NEXT: DXIL Translate Metadata
21+
; CHECK-NEXT: DXIL Prepare Module
22+
; CHECK-NEXT: DXIL Resource analysis
23+
; CHECK-NEXT: DXIL Metadata Pretty Printer
24+
; CHECK-NEXT: Print Module IR
25+

llvm/test/CodeGen/DirectX/scalarization_pass_order.ll

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
; RUN: llc %s -mtriple=dxil-pc-shadermodel6.3-library --filetype=asm -o - | FileCheck %s
2+
3+
; CHECK: target triple = "dxilv1.3-pc-shadermodel6.3-library"
4+
; CHECK-LABEL: cos_sin_float_test
5+
define noundef <4 x float> @cos_sin_float_test(<4 x float> noundef %a) {
6+
; CHECK: [[ee0:%.*]] = extractelement <4 x float> %a, i64 0
7+
; CHECK: [[ie0:%.*]] = call float @dx.op.unary.f32(i32 13, float [[ee0]])
8+
; CHECK: [[ee1:%.*]] = extractelement <4 x float> %a, i64 1
9+
; CHECK: [[ie1:%.*]] = call float @dx.op.unary.f32(i32 13, float [[ee1]])
10+
; CHECK: [[ee2:%.*]] = extractelement <4 x float> %a, i64 2
11+
; CHECK: [[ie2:%.*]] = call float @dx.op.unary.f32(i32 13, float [[ee2]])
12+
; CHECK: [[ee3:%.*]] = extractelement <4 x float> %a, i64 3
13+
; CHECK: [[ie3:%.*]] = call float @dx.op.unary.f32(i32 13, float [[ee3]])
14+
; CHECK: [[ie4:%.*]] = call float @dx.op.unary.f32(i32 12, float [[ie0]])
15+
; CHECK: [[ie5:%.*]] = call float @dx.op.unary.f32(i32 12, float [[ie1]])
16+
; CHECK: [[ie6:%.*]] = call float @dx.op.unary.f32(i32 12, float [[ie2]])
17+
; CHECK: [[ie7:%.*]] = call float @dx.op.unary.f32(i32 12, float [[ie3]])
18+
; CHECK: insertelement <4 x float> poison, float [[ie4]], i64 0
19+
; CHECK: insertelement <4 x float> %{{.*}}, float [[ie5]], i64 1
20+
; CHECK: insertelement <4 x float> %{{.*}}, float [[ie6]], i64 2
21+
; CHECK: insertelement <4 x float> %{{.*}}, float [[ie7]], i64 3
22+
%2 = tail call <4 x float> @llvm.sin.v4f32(<4 x float> %a)
23+
%3 = tail call <4 x float> @llvm.cos.v4f32(<4 x float> %2)
24+
ret <4 x float> %3
25+
}

llvm/test/CodeGen/DirectX/sin.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ entry:
3636

3737
declare half @llvm.sin.f16(half)
3838
declare float @llvm.sin.f32(float)
39-
declare <4 x float> @llvm.sin.v4f32(<4 x float>)
39+
declare <4 x float> @llvm.sin.v4f32(<4 x float>)

0 commit comments

Comments
 (0)