Skip to content

Commit b158eb8

Browse files
farzonlSterling-Augustine
authored andcommitted
[NFC][DirectX] Remove DXILIntrinsicExpansion as a required pass of DXILOpLowering (llvm#110750)
Updates tests and moves the code accordingly.
1 parent 0f9572f commit b158eb8

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

0 commit comments

Comments
 (0)