Skip to content

Commit 4812c40

Browse files
aratajewigcbot
authored andcommitted
Move types legalization from SPIRV Translator to OCL Unification
1 parent e5a415d commit 4812c40

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ THE SOFTWARE.
5454
#include "llvmWrapper/Support/TypeSize.h"
5555

5656
#include <llvm/Support/ScaledNumber.h>
57-
#include <llvm/IR/LegacyPassManager.h>
5857
#include <llvm/IR/IntrinsicInst.h>
5958
#include "libSPIRV/SPIRVDebugInfoExt.h"
6059
#include "llvm/Transforms/Utils/Cloning.h"
@@ -68,7 +67,6 @@ THE SOFTWARE.
6867
#include "libSPIRV/SPIRVMemAliasingINTEL.h"
6968
#include "SPIRVInternal.h"
7069
#include "common/MDFrameWork.h"
71-
#include "../../AdaptorCommon/TypesLegalizationPass.hpp"
7270
#include <llvm/Transforms/Scalar.h>
7371
#include <llvm/IR/MDBuilder.h>
7472

@@ -4534,11 +4532,6 @@ bool ReadSPIRV(LLVMContext &C, std::istream &IS, Module *&M,
45344532
Succeed = false;
45354533
}
45364534

4537-
llvm::legacy::PassManager PM;
4538-
PM.add(new TypesLegalizationPass());
4539-
PM.add(createDeadCodeEliminationPass());
4540-
PM.run(*M);
4541-
45424535
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
45434536
if (DbgSaveTmpLLVM)
45444537
dumpLLVM(M, DbgTmpLLVMFileName);

IGC/AdaptorOCL/UnifyIROCL.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ SPDX-License-Identifier: MIT
3131
#include "AdaptorCommon/AddImplicitArgs.hpp"
3232
#include "AdaptorCommon/ProcessFuncAttributes.h"
3333
#include "AdaptorCommon/LegalizeFunctionSignatures.h"
34+
#include "AdaptorCommon/TypesLegalizationPass.hpp"
3435
#include "common/LLVMUtils.h"
3536

3637
#include "Compiler/CISACodeGen/ShaderCodeGen.hpp"
@@ -259,6 +260,8 @@ static void CommonOCLBasedPasses(
259260
pContext->m_InternalOptions.EnableZEBinary;
260261

261262
IGCPassManager mpmSPIR(pContext, "Unify");
263+
mpmSPIR.add(new TypesLegalizationPass());
264+
mpmSPIR.add(createDeadCodeEliminationPass());
262265
mpmSPIR.add(new MetaDataUtilsWrapper(pMdUtils, pContext->getModuleMetaData()));
263266
mpmSPIR.add(new CodeGenContextWrapper(pContext));
264267
mpmSPIR.add(new SPIRMetaDataTranslation());

0 commit comments

Comments
 (0)