changeset 15225:aee7eeb554ad

[PTX] Fix PTX test regressions
author bharadwaj
date Thu, 17 Apr 2014 21:29:21 -0400
parents 735147ef0176
children f1c66b738dae 7aa0ef5348e5 1f7fd2cc008f
files graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java	Fri Apr 18 02:13:14 2014 +0200
+++ b/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java	Thu Apr 17 21:29:21 2014 -0400
@@ -830,13 +830,12 @@
 
     @Override
     public void emitReturn(Value input) {
-        AllocatableValue operand = Value.ILLEGAL;
         if (input != null) {
-            operand = resultOperandFor(input.getKind());
+            AllocatableValue operand = resultOperandFor(input.getKind());
             // Load the global memory address from return parameter
             Variable loadVar = emitLoadReturnAddress(operand.getKind(), operand, null);
-            // Store result in global memory whose location is loadVar
-            emitStoreReturnValue(operand.getKind(), loadVar, operand, null);
+            // Store input in global memory whose location is loadVar
+            emitStoreReturnValue(operand.getKind(), loadVar, input, null);
         }
         emitReturnNoVal();
     }