diff options
Diffstat (limited to 'Ryujinx.Graphics.Shader/StructuredIr/PhiFunctions.cs')
-rw-r--r-- | Ryujinx.Graphics.Shader/StructuredIr/PhiFunctions.cs | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/Ryujinx.Graphics.Shader/StructuredIr/PhiFunctions.cs b/Ryujinx.Graphics.Shader/StructuredIr/PhiFunctions.cs index 53391b62..541ca298 100644 --- a/Ryujinx.Graphics.Shader/StructuredIr/PhiFunctions.cs +++ b/Ryujinx.Graphics.Shader/StructuredIr/PhiFunctions.cs @@ -17,7 +17,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr { LinkedListNode<INode> nextNode = node.Next; - if (!(node.Value is PhiNode phi)) + if (node.Value is not PhiNode phi) { node = nextNode; @@ -32,7 +32,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr Operation copyOp = new Operation(Instruction.Copy, phi.Dest, src); - AddBeforeBranch(srcBlock, copyOp); + srcBlock.Append(copyOp); } block.Operations.Remove(node); @@ -41,34 +41,5 @@ namespace Ryujinx.Graphics.Shader.StructuredIr } } } - - private static void AddBeforeBranch(BasicBlock block, INode node) - { - INode lastOp = block.GetLastOp(); - - if (lastOp is Operation operation && IsControlFlowInst(operation.Inst)) - { - block.Operations.AddBefore(block.Operations.Last, node); - } - else - { - block.Operations.AddLast(node); - } - } - - private static bool IsControlFlowInst(Instruction inst) - { - switch (inst) - { - case Instruction.Branch: - case Instruction.BranchIfFalse: - case Instruction.BranchIfTrue: - case Instruction.Discard: - case Instruction.Return: - return true; - } - - return false; - } } }
\ No newline at end of file |