@@ -510,6 +510,36 @@ void SILCombiner::processInstruction(SILInstruction *I,
510510 Builder.getTrackingList ()->clear ();
511511}
512512
513+ namespace swift ::test {
514+ struct SILCombinerProcessInstruction {
515+ void operator ()(SILCombiner &combiner, SILInstruction *inst,
516+ SILCombineCanonicalize &canonicalizer, bool &madeChange) {
517+ combiner.processInstruction (inst, canonicalizer, madeChange);
518+ }
519+ };
520+ // Arguments:
521+ // - instruction: the instruction to be processed
522+ // - bool: remove cond_fails
523+ // - bool: enable lifetime canonicalization
524+ // Dumps:
525+ // - the function after the processing is attempted
526+ static FunctionTest SILCombineProcessInstruction (
527+ " sil_combine_process_instruction" ,
528+ [](auto &function, auto &arguments, auto &test) {
529+ auto inst = arguments.takeInstruction ();
530+ auto removeCondFails = arguments.takeBool ();
531+ auto enableCopyPropagation = arguments.takeBool ();
532+ SILCombiner combiner (test.getPass (), removeCondFails,
533+ enableCopyPropagation);
534+ SILCombineCanonicalize canonicalizer (combiner.Worklist ,
535+ *test.getDeadEndBlocks ());
536+ bool madeChange = false ;
537+ SILCombinerProcessInstruction ()(combiner, inst, canonicalizer,
538+ madeChange);
539+ function.dump ();
540+ });
541+ } // end namespace swift::test
542+
513543namespace swift ::test {
514544// Arguments:
515545// - instruction: the instruction to be visited
0 commit comments