summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-loop-unroll.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-02-20 12:24:00 -0800
committerGitHub <noreply@github.com>2024-02-20 12:24:00 -0800
commit4d20fd329956ac89408b1628a8291fea01bc9a6d (patch)
tree8e62d9c1ec05142fd25d0b31073fdb56d44691b0 /source/slang/slang-ir-loop-unroll.cpp
parent8e9b61e3bac69dbb37a1451b62302e688a017ced (diff)
Refactor compiler option representations. (#3598)
* Refactor compiler option representation. * Fix binary compatibility. * Add a test for specifying compiler options at link time. * Fix binary compatibility. * Fix binary compatibility. * Fix backward compatibility on matrix layout. * Fix. * Fix. * Fix. * Fix gfx. * Fix gfx. * Fix dynamic dispatch. * Polish.
Diffstat (limited to 'source/slang/slang-ir-loop-unroll.cpp')
-rw-r--r--source/slang/slang-ir-loop-unroll.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/slang/slang-ir-loop-unroll.cpp b/source/slang/slang-ir-loop-unroll.cpp
index d998f5e61..753c930a8 100644
--- a/source/slang/slang-ir-loop-unroll.cpp
+++ b/source/slang/slang-ir-loop-unroll.cpp
@@ -67,7 +67,7 @@ static int _getLoopMaxIterationsToUnroll(IRLoop* loopInst)
}
static void _foldAndSimplifyLoopIteration(
- TargetRequest* targetRequest,
+ TargetProgram* targetProgram,
IRBuilder& builder,
List<IRBlock*>& clonedBlocks,
IRBlock* firstIterationBreakBlock,
@@ -81,7 +81,7 @@ static void _foldAndSimplifyLoopIteration(
{
for (auto inst : b->getChildren())
{
- tryReplaceInstUsesWithSimplifiedValue(targetRequest, builder.getModule(), inst);
+ tryReplaceInstUsesWithSimplifiedValue(targetProgram, builder.getModule(), inst);
}
}
@@ -89,7 +89,7 @@ static void _foldAndSimplifyLoopIteration(
// the phi arguments for next iteration evaluated (args in the new loop inst).
for (auto inst : firstIterationBreakBlock->getChildren())
{
- tryReplaceInstUsesWithSimplifiedValue(targetRequest, builder.getModule(), inst);
+ tryReplaceInstUsesWithSimplifiedValue(targetProgram, builder.getModule(), inst);
}
// Fold conditional branches into unconditional branches if the condition is known.
@@ -148,7 +148,7 @@ static void _foldAndSimplifyLoopIteration(
// Returns true if we can statically determine that the loop terminated within the iteration limit.
// This operation assumes the loop does not have `continue` jumps, i.e. continueBlock == targetBlock.
static bool _unrollLoop(
- TargetRequest* targetRequest,
+ TargetProgram* targetProgram,
IRModule* module,
IRLoop* loopInst,
List<IRBlock*>& blocks)
@@ -341,7 +341,7 @@ static bool _unrollLoop(
// conditional jumps can be folded into unconditional jumps.
_foldAndSimplifyLoopIteration(
- targetRequest, builder, clonedBlocks, firstIterationBreakBlock, unreachableBlock);
+ targetProgram, builder, clonedBlocks, firstIterationBreakBlock, unreachableBlock);
// Now we have peeled off one iteration from the loop, we check if there are any
// branches into next iteration, if not, the loop terminates and we are done.
@@ -435,7 +435,7 @@ List<IRLoop*> collectLoopsInFunc(IRGlobalValueWithCode* func, const TFunc& filte
}
bool unrollLoopsInFunc(
- TargetRequest* targetRequest,
+ TargetProgram* targetProgram,
IRModule* module,
IRGlobalValueWithCode* func,
DiagnosticSink* sink)
@@ -453,7 +453,7 @@ bool unrollLoopsInFunc(
auto blocks = collectBlocksInRegion(func, loop);
auto loopLoc = loop->sourceLoc;
- if (!_unrollLoop(targetRequest, module, loop, blocks))
+ if (!_unrollLoop(targetProgram, module, loop, blocks))
{
if (sink)
sink->diagnose(loopLoc, Diagnostics::cannotUnrollLoop);
@@ -468,7 +468,7 @@ bool unrollLoopsInFunc(
return true;
}
-bool unrollLoopsInModule(TargetRequest* targetRequest, IRModule* module, DiagnosticSink* sink)
+bool unrollLoopsInModule(TargetProgram* target, IRModule* module, DiagnosticSink* sink)
{
SLANG_PROFILE;
@@ -479,7 +479,7 @@ bool unrollLoopsInModule(TargetRequest* targetRequest, IRModule* module, Diagnos
if (auto func = as<IRGlobalValueWithCode>(inst))
{
- bool result = unrollLoopsInFunc(targetRequest, module, func, sink);
+ bool result = unrollLoopsInFunc(target, module, func, sink);
if (!result)
return false;
}