From 5efde18dd25bc08fb6ea4ef5181040eb32e46d38 Mon Sep 17 00:00:00 2001 From: Che-Liang Chiou Date: Thu, 21 Apr 2011 10:56:58 +0000 Subject: [PATCH] ptx: fix parameter ordering This patch depends on the prior fix r129908 that changes to use std::find, rather than std::binary_search, on unordered array. Patch by Dan Bailey git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129909 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PTX/PTXMachineFunctionInfo.h | 5 +---- test/CodeGen/PTX/parameter-order.ll | 8 ++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/Target/PTX/PTXMachineFunctionInfo.h b/lib/Target/PTX/PTXMachineFunctionInfo.h index a0425958042..81df1c236cb 100644 --- a/lib/Target/PTX/PTXMachineFunctionInfo.h +++ b/lib/Target/PTX/PTXMachineFunctionInfo.h @@ -42,12 +42,9 @@ public: void setRetReg(unsigned reg) { reg_ret = reg; } void doneAddArg(void) { - std::sort(reg_arg.begin(), reg_arg.end()); _isDoneAddArg = true; } - void doneAddLocalVar(void) { - std::sort(reg_local_var.begin(), reg_local_var.end()); - } + void doneAddLocalVar(void) {} bool isDoneAddArg(void) { return _isDoneAddArg; } diff --git a/test/CodeGen/PTX/parameter-order.ll b/test/CodeGen/PTX/parameter-order.ll index 8131f13a6e8..95d4a328149 100644 --- a/test/CodeGen/PTX/parameter-order.ll +++ b/test/CodeGen/PTX/parameter-order.ll @@ -1,8 +1,8 @@ ; RUN: llc < %s -march=ptx32 | FileCheck %s -; CHECK: .func (.reg .u32 r0) test_parameter_order (.reg .u32 r1, .reg .u32 r2) -define ptx_device i32 @test_parameter_order(i32 %x, i32 %y) { +; CHECK: .func (.reg .u32 r0) test_parameter_order (.reg .f32 f1, .reg .u32 r1, .reg .u32 r2, .reg .f32 f2) +define ptx_device i32 @test_parameter_order(float %a, i32 %b, i32 %c, float %d) { ; CHECK: sub.u32 r0, r1, r2 - %z = sub i32 %x, %y - ret i32 %z + %result = sub i32 %b, %c + ret i32 %result }