From a0ee2bf671d61d1e2b561db3966e57ffc802040f Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Thu, 17 Aug 2023 13:41:49 +0800 Subject: Add loop inversion pass (#2899) * Generalize collectInductionValues * Support affine transformations of loop index as induction variables * Test for generalized induction value collection * Neaten inductive variable finding * Make types more specific * Add loop inversion pass * Test output changes after loop inversion * Store the type of implication success when finding inductive variables * Test that loop induction finding does not alway succeed * Support chains of additions and branches of additions in induction variable finding * Use c++17 for downstream compilers * Wiggle expected output for cross compile test after loop inversion * Add loop inversion test * Simplify IfElse instructions with a single trivial block * Invert loops with a user inserted break * Limit loop inversion to loops with a 4 instruction or less comparison block * regenerate vs projects --- source/slang/slang-ir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 421c60d1d..1a499842d 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -5134,7 +5134,7 @@ namespace Slang return inst; } - IRInst* IRBuilder::emitIfElse( + IRIfElse* IRBuilder::emitIfElse( IRInst* val, IRBlock* trueBlock, IRBlock* falseBlock, -- cgit v1.2.3