From aadd816a6f38c52e2577c807c023a3b775a21ba6 Mon Sep 17 00:00:00 2001 From: Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> Date: Thu, 3 Aug 2023 14:03:51 -0400 Subject: Disable code motion for expensive insts (call & div) (#3042) * Disable code motion for expensive insts (call & div) The current redundancy removal pass does not consider control-flow within loops and as a result can sometimes move dynamic dispatch code outside their switch blocks, if they are nested in a single-iter-loop. * Update liveness.slang.expected --- source/slang/slang-ir-redundancy-removal.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'source') diff --git a/source/slang/slang-ir-redundancy-removal.cpp b/source/slang/slang-ir-redundancy-removal.cpp index e0bb0b224..5f476188e 100644 --- a/source/slang/slang-ir-redundancy-removal.cpp +++ b/source/slang/slang-ir-redundancy-removal.cpp @@ -19,7 +19,6 @@ struct RedundancyRemovalContext case kIROp_Add: case kIROp_Sub: case kIROp_Mul: - case kIROp_Div: case kIROp_FRem: case kIROp_IRem: case kIROp_Lsh: @@ -78,8 +77,6 @@ struct RedundancyRemovalContext case kIROp_ExtractExistentialValue: case kIROp_ExtractExistentialWitnessTable: return true; - case kIROp_Call: - return isPureFunctionalCall(as(inst)); case kIROp_Load: // Load is generally not movable, an exception is loading a global constant buffer. if (auto load = as(inst)) -- cgit v1.2.3