Skip to content

Commit 7d0ca60

Browse files
authored
[NFC][DirectX] Remove DXILIntrinsicExpansion as a required pass of DXILOpLowering (#110750)
Updates tests and moves the code accordingly.
1 parent add6b2f commit 7d0ca60

21 files changed

+27
-29
lines changed

llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@
3333

3434
using namespace llvm;
3535

36+
class DXILIntrinsicExpansionLegacy : public ModulePass {
37+
38+
public:
39+
bool runOnModule(Module &M) override;
40+
DXILIntrinsicExpansionLegacy() : ModulePass(ID) {}
41+
42+
void getAnalysisUsage(AnalysisUsage &AU) const override;
43+
static char ID; // Pass identification.
44+
};
45+
3646
static bool isIntrinsicExpansion(Function &F) {
3747
switch (F.getIntrinsicID()) {
3848
case Intrinsic::abs:

llvm/lib/Target/DirectX/DXILIntrinsicExpansion.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@ class DXILIntrinsicExpansion : public PassInfoMixin<DXILIntrinsicExpansion> {
1919
public:
2020
PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
2121
};
22-
23-
class DXILIntrinsicExpansionLegacy : public ModulePass {
24-
25-
public:
26-
bool runOnModule(Module &M) override;
27-
DXILIntrinsicExpansionLegacy() : ModulePass(ID) {}
28-
29-
void getAnalysisUsage(AnalysisUsage &AU) const override;
30-
static char ID; // Pass identification.
31-
};
3222
} // namespace llvm
3323

3424
#endif // LLVM_TARGET_DIRECTX_DXILINTRINSICEXPANSION_H

llvm/lib/Target/DirectX/DXILOpLowering.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,6 @@ class DXILOpLoweringLegacy : public ModulePass {
525525

526526
static char ID; // Pass identification.
527527
void getAnalysisUsage(llvm::AnalysisUsage &AU) const override {
528-
AU.addRequired<DXILIntrinsicExpansionLegacy>();
529528
AU.addRequired<DXILResourceWrapperPass>();
530529
AU.addPreserved<DXILResourceWrapperPass>();
531530
}

llvm/test/CodeGen/DirectX/abs.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK
2-
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
2+
; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
33

44
; Make sure dxil operation function calls for abs are generated for int16_t/int/int64_t.
55

llvm/test/CodeGen/DirectX/atan2_error.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
1+
; RUN: not opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
22

33
; DXIL operation atan does not support double overload type
44
; CHECK: in function atan2_double

llvm/test/CodeGen/DirectX/clamp.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
1+
; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
22

33
; Make sure dxil operation function calls for clamp/uclamp are generated for half/float/double/i16/i32/i64.
44

llvm/test/CodeGen/DirectX/exp.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
1+
; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
22

33
; Make sure dxil operation function calls for exp are generated for float and half.
44

llvm/test/CodeGen/DirectX/fdot.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK
2-
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
2+
; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
33

44
; Make sure dxil operation function calls for dot are generated for float type vectors.
55

llvm/test/CodeGen/DirectX/idot.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK
2-
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
2+
; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
33

44
; Make sure dxil operation function calls for dot are generated for int/uint vectors.
55

llvm/test/CodeGen/DirectX/length.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: opt -S -dxil-intrinsic-expansion < %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK
2-
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library < %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
2+
; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library < %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
33

44
; Make sure dxil operation function calls for length are generated for half/float.
55

llvm/test/CodeGen/DirectX/length_error.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
1+
; RUN: not opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
22

33
; DXIL operation length does not support double overload type
44
; CHECK: Cannot create Sqrt operation: Invalid overload type

llvm/test/CodeGen/DirectX/length_invalid_intrinsic_error.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
1+
; RUN: not opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
22

33
; DXIL operation length does not support 1-element vector types.
44
; CHECK: LLVM ERROR: Invalid input type for length intrinsic

llvm/test/CodeGen/DirectX/lerp.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.0-library < %s | FileCheck %s
1+
; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.0-library < %s | FileCheck %s
22

33
; Make sure dxil operation function calls for lerp are generated for float and half.
44

llvm/test/CodeGen/DirectX/llc-pipeline.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
; CHECK-NEXT: FunctionPass Manager
1313
; CHECK-NEXT: Dominator Tree Construction
1414
; CHECK-NEXT: Scalarize vector operations
15-
; CHECK-NEXT: DXIL Intrinsic Expansion
1615
; CHECK-NEXT: DXIL Resource analysis
1716
; CHECK-NEXT: DXIL Op Lowering
1817
; CHECK-NEXT: DXIL Finalize Linkage

llvm/test/CodeGen/DirectX/log.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK
2-
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
2+
; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
33

44
; Make sure dxil operation function calls for log are generated.
55

llvm/test/CodeGen/DirectX/log10.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK
2-
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
2+
; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
33

44
; Make sure dxil operation function calls for log10 are generated.
55

llvm/test/CodeGen/DirectX/normalize.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: opt -S -dxil-intrinsic-expansion < %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK
2-
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library < %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
2+
; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library < %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
33

44
; Make sure dxil operation function calls for normalize are generated for half/float.
55

llvm/test/CodeGen/DirectX/normalize_error.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
1+
; RUN: not opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
22

33
; DXIL operation normalize does not support double overload type
44
; CHECK: Cannot create Dot2 operation: Invalid overload type

llvm/test/CodeGen/DirectX/pow.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK
2-
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
2+
; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK
33

44
; Make sure dxil operation function calls for pow are generated.
55

llvm/test/CodeGen/DirectX/sign.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2-
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
2+
; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
33

44

55
define noundef i32 @sign_half(half noundef %a) {

llvm/test/CodeGen/DirectX/step.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: opt -S -dxil-intrinsic-expansion < %s | FileCheck %s --check-prefix=CHECK
2-
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library < %s | FileCheck %s --check-prefix=CHECK
2+
; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library < %s | FileCheck %s --check-prefix=CHECK
33

44
; Make sure dxil operation function calls for step are generated for half/float.
55

0 commit comments

Comments
 (0)