Skip to content

Commit 5f8800a

Browse files
aratajewigcbot
authored andcommitted
Move DCE after all SPIRV metadata related passes
`HandleSpirvDecorationMetadata` transforms `spirv.Decorations` metadata produced by Khronos SPIRV-LLVM Translator into internal IGC's representation. The metadata can be attached to instructions that may be removed by DCE pass, hence losing them.
1 parent bf1d7c1 commit 5f8800a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

IGC/AdaptorOCL/UnifyIROCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,14 @@ static void CommonOCLBasedPasses(
325325
#endif // IGC_SCALAR_USE_KHRONOS_SPIRV_TRANSLATOR
326326
mpmSPIR.add(new TypesLegalizationPass());
327327
mpmSPIR.add(new TargetLibraryInfoWrapperPass());
328-
mpmSPIR.add(createDeadCodeEliminationPass());
329328
mpmSPIR.add(new MetaDataUtilsWrapper(pMdUtils, pContext->getModuleMetaData()));
330329
mpmSPIR.add(new CodeGenContextWrapper(pContext));
331330
mpmSPIR.add(new SPIRMetaDataTranslation());
332331
#ifdef IGC_SCALAR_USE_KHRONOS_SPIRV_TRANSLATOR
333332
mpmSPIR.add(new ConvertUserSemanticDecoratorOnFunctions());
334333
#endif // IGC_SCALAR_USE_KHRONOS_SPIRV_TRANSLATOR
335334
mpmSPIR.add(new HandleSpirvDecorationMetadata());
335+
mpmSPIR.add(createDeadCodeEliminationPass());
336336
mpmSPIR.run(*pContext->getModule());
337337

338338
bool isOptDisabled = CompilerOpts.OptDisable;

0 commit comments

Comments
 (0)