llvm.org GIT mirror llvm / 5efde18
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 Che-Liang Chiou 9 years ago
2 changed file(s) with 5 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
4141 void setRetReg(unsigned reg) { reg_ret = reg; }
4242
4343 void doneAddArg(void) {
44 std::sort(reg_arg.begin(), reg_arg.end());
4544 _isDoneAddArg = true;
4645 }
47 void doneAddLocalVar(void) {
48 std::sort(reg_local_var.begin(), reg_local_var.end());
49 }
46 void doneAddLocalVar(void) {}
5047
5148 bool isDoneAddArg(void) { return _isDoneAddArg; }
5249
0 ; RUN: llc < %s -march=ptx32 | FileCheck %s
11
2 ; CHECK: .func (.reg .u32 r0) test_parameter_order (.reg .u32 r1, .reg .u32 r2)
3 define ptx_device i32 @test_parameter_order(i32 %x, i32 %y) {
2 ; CHECK: .func (.reg .u32 r0) test_parameter_order (.reg .f32 f1, .reg .u32 r1, .reg .u32 r2, .reg .f32 f2)
3 define ptx_device i32 @test_parameter_order(float %a, i32 %b, i32 %c, float %d) {
44 ; CHECK: sub.u32 r0, r1, r2
5 %z = sub i32 %x, %y
6 ret i32 %z
5 %result = sub i32 %b, %c
6 ret i32 %result
77 }