Skip to content

Commit cef01ab

Browse files
Anton Sidorenkoigcbot
authored andcommitted
Run aggregates pseudo lowering after prolog/epilog
Aggregates pseudo lowering must be run after prolog/epilog insertion as the latter may create loads or stores of aggregates to stack.
1 parent e7ddd67 commit cef01ab

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXTargetMachine.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -320,16 +320,6 @@ bool GenXTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
320320
vc::addPass(PM, createVerifierPass());
321321
// Run passes to generate vISA.
322322

323-
/// .. include:: GenXAggregatePseudoLowering.cpp
324-
vc::addPass(PM, createGenXAggregatePseudoLoweringPass());
325-
/// InstructionCombining
326-
/// --------------------
327-
/// This is a standard LLVM pass, used at this point in the GenX backend.
328-
///
329-
vc::addPass(PM, createInstructionCombiningPass());
330-
331-
// Aggregate pseudo lowering may create GEPs to be lowered before TPM
332-
333323
/// BasicAliasAnalysis
334324
/// ------------------
335325
/// This is a standard LLVM analysis pass to provide basic AliasAnalysis
@@ -376,6 +366,12 @@ bool GenXTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
376366
// PrologEpilog may emit memory instructions of illegal width.
377367
vc::addPass(PM, createGenXPrologEpilogInsertionPass());
378368

369+
/// .. include:: GenXAggregatePseudoLowering.cpp
370+
/// GenXAggregatePseudoLowering must be run after
371+
/// GenXPrologEpilogInsertion as the latter may create stack loads and stores
372+
/// of aggregates.
373+
vc::addPass(PM, createGenXAggregatePseudoLoweringPass());
374+
379375
/// .. include:: GenXGEPLowering.cpp
380376
vc::addPass(PM, createGenXGEPLoweringPass());
381377
/// .. include:: GenXLoadStoreLowering.cpp
@@ -387,6 +383,9 @@ bool GenXTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
387383
/// This is a standard LLVM pass, used at this point in the GenX backend.
388384
/// Run instcombine after some lowering passes (e.g. GenXLoadStoreLowering) to
389385
/// make a cleanup.
386+
/// Cleans up after bunch of lowering passes such as
387+
/// GenXPrologEpilogInsertion, GenXAggregatePseudoLowering,
388+
/// GenXLoadStoreLowering.
390389
vc::addPass(PM, createInstructionCombiningPass());
391390
// Run integer reduction again to revert some trunc/ext patterns transformed
392391
// by instcombine.

0 commit comments

Comments
 (0)