Skip to content

Commit ff9ce8a

Browse files
Anton Sidorenkoigcbot
Anton Sidorenko
authored andcommitted
Run prologepilog and loadstore lowering before instcombine
Instcombine must be run after prologepilog and loadstore lowering passes to make necessary cleanup.
1 parent 5646cf4 commit ff9ce8a

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXTargetMachine.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -348,18 +348,6 @@ bool GenXTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
348348
vc::addPass(PM, createGenXReduceIntSizePass());
349349
/// .. include:: GenXGlobalValueLowering.cpp
350350
vc::addPass(PM, createGenXGlobalValueLoweringPass());
351-
/// InstructionCombining
352-
/// --------------------
353-
/// This is a standard LLVM pass, used at this point in the GenX backend.
354-
///
355-
vc::addPass(PM, createInstructionCombiningPass());
356-
// Run integer reduction again to revert some trunc/ext patterns transformed
357-
// by instcombine.
358-
vc::addPass(PM, createGenXReduceIntSizePass());
359-
/// .. include:: GenXSimdCFConformance.cpp
360-
vc::addPass(PM, createGenXEarlySimdCFConformancePass());
361-
/// .. include:: GenXPromotePredicate.cpp
362-
vc::addPass(PM, createGenXPromotePredicatePass());
363351

364352
/// .. include:: GenXStackUsage.cpp
365353
vc::addPass(PM, createGenXStackUsagePass());
@@ -373,6 +361,20 @@ bool GenXTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
373361
vc::addPass(PM, createGenXLoadStoreLoweringPass());
374362
vc::addPass(PM, createGenXThreadPrivateMemoryPass());
375363

364+
/// InstructionCombining
365+
/// --------------------
366+
/// This is a standard LLVM pass, used at this point in the GenX backend.
367+
/// Run instcombine after some lowering passes (e.g. GenXLoadStoreLowering) to
368+
/// make a cleanup.
369+
vc::addPass(PM, createInstructionCombiningPass());
370+
// Run integer reduction again to revert some trunc/ext patterns transformed
371+
// by instcombine.
372+
vc::addPass(PM, createGenXReduceIntSizePass());
373+
/// .. include:: GenXSimdCFConformance.cpp
374+
vc::addPass(PM, createGenXEarlySimdCFConformancePass());
375+
/// .. include:: GenXPromotePredicate.cpp
376+
vc::addPass(PM, createGenXPromotePredicatePass());
377+
376378
// Run GEP lowering again to remove possible GEPs after instcombine.
377379
vc::addPass(PM, createGenXGEPLoweringPass());
378380
/// .. include:: GenXLowering.cpp

0 commit comments

Comments
 (0)