From 66cbcf7931602b2b2588dacde99586d0825d8f42 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Thu, 15 Aug 2024 00:27:45 +0300 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20change?= =?UTF-8?q?s=20to=20main=20this=20commit=20is=20based=20on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.5-bogner [skip ci] --- llvm/lib/Target/DirectX/DXILOpBuilder.cpp | 2 +- llvm/lib/Target/DirectX/DXILOpBuilder.h | 14 +------------- llvm/lib/Target/DirectX/DXILResourceAnalysis.h | 4 ++++ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/llvm/lib/Target/DirectX/DXILOpBuilder.cpp b/llvm/lib/Target/DirectX/DXILOpBuilder.cpp index 42df7c90cb337..91e6931b3f788 100644 --- a/llvm/lib/Target/DirectX/DXILOpBuilder.cpp +++ b/llvm/lib/Target/DirectX/DXILOpBuilder.cpp @@ -424,7 +424,7 @@ Expected DXILOpBuilder::tryCreateOp(dxil::OpCode OpCode, return B.CreateCall(DXILFn, OpArgs); } -CallInst *DXILOpBuilder::createOp(dxil::OpCode OpCode, ArrayRef &Args, +CallInst *DXILOpBuilder::createOp(dxil::OpCode OpCode, ArrayRef Args, Type *RetTy) { Expected Result = tryCreateOp(OpCode, Args, RetTy); if (Error E = Result.takeError()) diff --git a/llvm/lib/Target/DirectX/DXILOpBuilder.h b/llvm/lib/Target/DirectX/DXILOpBuilder.h index ff66f39a3ceb3..5d83357f7a2e9 100644 --- a/llvm/lib/Target/DirectX/DXILOpBuilder.h +++ b/llvm/lib/Target/DirectX/DXILOpBuilder.h @@ -33,25 +33,13 @@ class DXILOpBuilder { /// Create a call instruction for the given DXIL op. The arguments /// must be valid for an overload of the operation. - CallInst *createOp(dxil::OpCode Op, ArrayRef &Args, + CallInst *createOp(dxil::OpCode Op, ArrayRef Args, Type *RetTy = nullptr); -#define DXIL_OPCODE(Op, Name) \ - CallInst *create##Name##Op(ArrayRef &Args, Type *RetTy = nullptr) { \ - return createOp(dxil::OpCode(Op), Args, RetTy); \ - } -#include "DXILOperation.inc" - /// Try to create a call instruction for the given DXIL op. Fails if the /// overload is invalid. Expected tryCreateOp(dxil::OpCode Op, ArrayRef Args, Type *RetTy = nullptr); -#define DXIL_OPCODE(Op, Name) \ - Expected tryCreate##Name##Op(ArrayRef &Args, \ - Type *RetTy = nullptr) { \ - return tryCreateOp(dxil::OpCode(Op), Args, RetTy); \ - } -#include "DXILOperation.inc" /// Return the name of the given opcode. static const char *getOpCodeName(dxil::OpCode DXILOp); diff --git a/llvm/lib/Target/DirectX/DXILResourceAnalysis.h b/llvm/lib/Target/DirectX/DXILResourceAnalysis.h index 3a2b8a9fd39d5..26d9237d51b49 100644 --- a/llvm/lib/Target/DirectX/DXILResourceAnalysis.h +++ b/llvm/lib/Target/DirectX/DXILResourceAnalysis.h @@ -57,6 +57,10 @@ class DXILResourceMDWrapper : public ModulePass { /// Calculate the DXILResource for the module. bool runOnModule(Module &M) override; + void getAnalysisUsage(AnalysisUsage &AU) const override { + AU.setPreservesAll(); + } + void print(raw_ostream &O, const Module *M = nullptr) const override; }; } // namespace llvm