From 51f33112a928fdb12973588b25fb849ce7bbc5f7 Mon Sep 17 00:00:00 2001 From: Farzon Lotfi Date: Tue, 1 Oct 2024 17:51:22 -0400 Subject: [PATCH] [NFC][DirectX] Remove DXILIntrinsicExpansion as a rquired pass of DXILOpLowering --- llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp | 10 ++++++++++ llvm/lib/Target/DirectX/DXILIntrinsicExpansion.h | 10 ---------- llvm/lib/Target/DirectX/DXILOpLowering.cpp | 1 - llvm/test/CodeGen/DirectX/abs.ll | 2 +- llvm/test/CodeGen/DirectX/atan2_error.ll | 2 +- llvm/test/CodeGen/DirectX/clamp.ll | 2 +- llvm/test/CodeGen/DirectX/exp.ll | 2 +- llvm/test/CodeGen/DirectX/fdot.ll | 2 +- llvm/test/CodeGen/DirectX/idot.ll | 2 +- llvm/test/CodeGen/DirectX/length.ll | 2 +- llvm/test/CodeGen/DirectX/length_error.ll | 2 +- .../CodeGen/DirectX/length_invalid_intrinsic_error.ll | 2 +- llvm/test/CodeGen/DirectX/lerp.ll | 2 +- llvm/test/CodeGen/DirectX/llc-pipeline.ll | 1 - llvm/test/CodeGen/DirectX/log.ll | 2 +- llvm/test/CodeGen/DirectX/log10.ll | 2 +- llvm/test/CodeGen/DirectX/normalize.ll | 2 +- llvm/test/CodeGen/DirectX/normalize_error.ll | 2 +- llvm/test/CodeGen/DirectX/pow.ll | 2 +- llvm/test/CodeGen/DirectX/sign.ll | 2 +- llvm/test/CodeGen/DirectX/step.ll | 2 +- 21 files changed, 27 insertions(+), 29 deletions(-) diff --git a/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp b/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp index 926cbe97f24fda5..fca5af9d19141e2 100644 --- a/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp +++ b/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp @@ -33,6 +33,16 @@ using namespace llvm; +class DXILIntrinsicExpansionLegacy : public ModulePass { + +public: + bool runOnModule(Module &M) override; + DXILIntrinsicExpansionLegacy() : ModulePass(ID) {} + + void getAnalysisUsage(AnalysisUsage &AU) const override; + static char ID; // Pass identification. +}; + static bool isIntrinsicExpansion(Function &F) { switch (F.getIntrinsicID()) { case Intrinsic::abs: diff --git a/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.h b/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.h index c8ee4b1b934b2d9..c283386c6e3df18 100644 --- a/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.h +++ b/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.h @@ -19,16 +19,6 @@ class DXILIntrinsicExpansion : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &); }; - -class DXILIntrinsicExpansionLegacy : public ModulePass { - -public: - bool runOnModule(Module &M) override; - DXILIntrinsicExpansionLegacy() : ModulePass(ID) {} - - void getAnalysisUsage(AnalysisUsage &AU) const override; - static char ID; // Pass identification. -}; } // namespace llvm #endif // LLVM_TARGET_DIRECTX_DXILINTRINSICEXPANSION_H diff --git a/llvm/lib/Target/DirectX/DXILOpLowering.cpp b/llvm/lib/Target/DirectX/DXILOpLowering.cpp index 3ee3ee05563c241..c0f8d433833ee73 100644 --- a/llvm/lib/Target/DirectX/DXILOpLowering.cpp +++ b/llvm/lib/Target/DirectX/DXILOpLowering.cpp @@ -525,7 +525,6 @@ class DXILOpLoweringLegacy : public ModulePass { static char ID; // Pass identification. void getAnalysisUsage(llvm::AnalysisUsage &AU) const override { - AU.addRequired(); AU.addRequired(); AU.addPreserved(); } diff --git a/llvm/test/CodeGen/DirectX/abs.ll b/llvm/test/CodeGen/DirectX/abs.ll index 85090a51c55a40c..34464e9db14cbf4 100644 --- a/llvm/test/CodeGen/DirectX/abs.ll +++ b/llvm/test/CodeGen/DirectX/abs.ll @@ -1,5 +1,5 @@ ; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK -; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK +; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK ; Make sure dxil operation function calls for abs are generated for int16_t/int/int64_t. diff --git a/llvm/test/CodeGen/DirectX/atan2_error.ll b/llvm/test/CodeGen/DirectX/atan2_error.ll index 5b3077f85f5d4ed..372934098b7cab6 100644 --- a/llvm/test/CodeGen/DirectX/atan2_error.ll +++ b/llvm/test/CodeGen/DirectX/atan2_error.ll @@ -1,4 +1,4 @@ -; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s +; RUN: not opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s ; DXIL operation atan does not support double overload type ; CHECK: in function atan2_double diff --git a/llvm/test/CodeGen/DirectX/clamp.ll b/llvm/test/CodeGen/DirectX/clamp.ll index 2f29e4479f9ca1f..23aadf893e8ca76 100644 --- a/llvm/test/CodeGen/DirectX/clamp.ll +++ b/llvm/test/CodeGen/DirectX/clamp.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s +; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s ; Make sure dxil operation function calls for clamp/uclamp are generated for half/float/double/i16/i32/i64. diff --git a/llvm/test/CodeGen/DirectX/exp.ll b/llvm/test/CodeGen/DirectX/exp.ll index f67e2744c4ee349..c2d9938d27ecda1 100644 --- a/llvm/test/CodeGen/DirectX/exp.ll +++ b/llvm/test/CodeGen/DirectX/exp.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s +; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s ; Make sure dxil operation function calls for exp are generated for float and half. diff --git a/llvm/test/CodeGen/DirectX/fdot.ll b/llvm/test/CodeGen/DirectX/fdot.ll index aa1b15972e266dc..78e111c41feefd3 100644 --- a/llvm/test/CodeGen/DirectX/fdot.ll +++ b/llvm/test/CodeGen/DirectX/fdot.ll @@ -1,5 +1,5 @@ ; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK -; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK +; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK ; Make sure dxil operation function calls for dot are generated for float type vectors. diff --git a/llvm/test/CodeGen/DirectX/idot.ll b/llvm/test/CodeGen/DirectX/idot.ll index 5848868ed0556ac..26e7ff395bd16b4 100644 --- a/llvm/test/CodeGen/DirectX/idot.ll +++ b/llvm/test/CodeGen/DirectX/idot.ll @@ -1,5 +1,5 @@ ; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK -; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK +; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK ; Make sure dxil operation function calls for dot are generated for int/uint vectors. diff --git a/llvm/test/CodeGen/DirectX/length.ll b/llvm/test/CodeGen/DirectX/length.ll index d12fcf4722a07bc..fc5868a7f6e82c4 100644 --- a/llvm/test/CodeGen/DirectX/length.ll +++ b/llvm/test/CodeGen/DirectX/length.ll @@ -1,5 +1,5 @@ ; RUN: opt -S -dxil-intrinsic-expansion < %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK -; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library < %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK +; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library < %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK ; Make sure dxil operation function calls for length are generated for half/float. diff --git a/llvm/test/CodeGen/DirectX/length_error.ll b/llvm/test/CodeGen/DirectX/length_error.ll index e1899c8deb51577..143b41fc506e1dc 100644 --- a/llvm/test/CodeGen/DirectX/length_error.ll +++ b/llvm/test/CodeGen/DirectX/length_error.ll @@ -1,4 +1,4 @@ -; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s +; RUN: not opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s ; DXIL operation length does not support double overload type ; CHECK: Cannot create Sqrt operation: Invalid overload type diff --git a/llvm/test/CodeGen/DirectX/length_invalid_intrinsic_error.ll b/llvm/test/CodeGen/DirectX/length_invalid_intrinsic_error.ll index 277fbaa462b0faf..f722de2f9029e77 100644 --- a/llvm/test/CodeGen/DirectX/length_invalid_intrinsic_error.ll +++ b/llvm/test/CodeGen/DirectX/length_invalid_intrinsic_error.ll @@ -1,4 +1,4 @@ -; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s +; RUN: not opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s ; DXIL operation length does not support 1-element vector types. ; CHECK: LLVM ERROR: Invalid input type for length intrinsic diff --git a/llvm/test/CodeGen/DirectX/lerp.ll b/llvm/test/CodeGen/DirectX/lerp.ll index 9f5e4c7710d2136..9ea0861cff26576 100644 --- a/llvm/test/CodeGen/DirectX/lerp.ll +++ b/llvm/test/CodeGen/DirectX/lerp.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.0-library < %s | FileCheck %s +; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.0-library < %s | FileCheck %s ; Make sure dxil operation function calls for lerp are generated for float and half. diff --git a/llvm/test/CodeGen/DirectX/llc-pipeline.ll b/llvm/test/CodeGen/DirectX/llc-pipeline.ll index 102748508b4ad76..224037cfe7fbe38 100644 --- a/llvm/test/CodeGen/DirectX/llc-pipeline.ll +++ b/llvm/test/CodeGen/DirectX/llc-pipeline.ll @@ -12,7 +12,6 @@ ; CHECK-NEXT: FunctionPass Manager ; CHECK-NEXT: Dominator Tree Construction ; CHECK-NEXT: Scalarize vector operations -; CHECK-NEXT: DXIL Intrinsic Expansion ; CHECK-NEXT: DXIL Resource analysis ; CHECK-NEXT: DXIL Op Lowering ; CHECK-NEXT: DXIL Finalize Linkage diff --git a/llvm/test/CodeGen/DirectX/log.ll b/llvm/test/CodeGen/DirectX/log.ll index ee289088d243b17..195713309cd448c 100644 --- a/llvm/test/CodeGen/DirectX/log.ll +++ b/llvm/test/CodeGen/DirectX/log.ll @@ -1,5 +1,5 @@ ; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK -; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK +; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK ; Make sure dxil operation function calls for log are generated. diff --git a/llvm/test/CodeGen/DirectX/log10.ll b/llvm/test/CodeGen/DirectX/log10.ll index a69f270f9dc88e8..f3acccce7e451ad 100644 --- a/llvm/test/CodeGen/DirectX/log10.ll +++ b/llvm/test/CodeGen/DirectX/log10.ll @@ -1,5 +1,5 @@ ; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK -; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK +; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK ; Make sure dxil operation function calls for log10 are generated. diff --git a/llvm/test/CodeGen/DirectX/normalize.ll b/llvm/test/CodeGen/DirectX/normalize.ll index e2c8a5d4656a65c..2aba9d5f74d78ef 100644 --- a/llvm/test/CodeGen/DirectX/normalize.ll +++ b/llvm/test/CodeGen/DirectX/normalize.ll @@ -1,5 +1,5 @@ ; RUN: opt -S -dxil-intrinsic-expansion < %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK -; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library < %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK +; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library < %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK ; Make sure dxil operation function calls for normalize are generated for half/float. diff --git a/llvm/test/CodeGen/DirectX/normalize_error.ll b/llvm/test/CodeGen/DirectX/normalize_error.ll index da0905690236dbd..35a91c0cdc24df7 100644 --- a/llvm/test/CodeGen/DirectX/normalize_error.ll +++ b/llvm/test/CodeGen/DirectX/normalize_error.ll @@ -1,4 +1,4 @@ -; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s +; RUN: not opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s ; DXIL operation normalize does not support double overload type ; CHECK: Cannot create Dot2 operation: Invalid overload type diff --git a/llvm/test/CodeGen/DirectX/pow.ll b/llvm/test/CodeGen/DirectX/pow.ll index 0e83c4ff8add67f..378649ec119d55e 100644 --- a/llvm/test/CodeGen/DirectX/pow.ll +++ b/llvm/test/CodeGen/DirectX/pow.ll @@ -1,5 +1,5 @@ ; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK -; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK +; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK ; Make sure dxil operation function calls for pow are generated. diff --git a/llvm/test/CodeGen/DirectX/sign.ll b/llvm/test/CodeGen/DirectX/sign.ll index 0a1631bd5ddc1f5..47e51b28d208445 100644 --- a/llvm/test/CodeGen/DirectX/sign.ll +++ b/llvm/test/CodeGen/DirectX/sign.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 -; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s +; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s define noundef i32 @sign_half(half noundef %a) { diff --git a/llvm/test/CodeGen/DirectX/step.ll b/llvm/test/CodeGen/DirectX/step.ll index 0393c1533cb9392..1c9894026c62ec7 100644 --- a/llvm/test/CodeGen/DirectX/step.ll +++ b/llvm/test/CodeGen/DirectX/step.ll @@ -1,5 +1,5 @@ ; RUN: opt -S -dxil-intrinsic-expansion < %s | FileCheck %s --check-prefix=CHECK -; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library < %s | FileCheck %s --check-prefix=CHECK +; RUN: opt -S -dxil-intrinsic-expansion -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library < %s | FileCheck %s --check-prefix=CHECK ; Make sure dxil operation function calls for step are generated for half/float.