Using CallingConvLower in ARM target

I'm not currently setup to be able to run the A/B comparison tests
that test-suite relies upon.

Fhourstones-3.1 looks to be the simplest. If you can send me the two
.o files from either EABI or Darwin, I can dig into why this went
wrong for you.

deep

After wasting an inordinate amount of time trying to get test-suite to
run on arm-apple-darwin so I could reproduce your results, attached is
a patch that fixes the small copy&paste error of having 8-byte
alignment for stack-allocated f64s instead of the proper 4-byte. I've
updated the patch to the top of trunk changes as well.

deep

arm_callingconv.patch (55.2 KB)

Greetings Sandeep

I have tested crosscompiling llvm2.6 svn trunk 69279 + your patch for armv7a hardware.
I wanted to see if it would build and if any unexpected failing tests in the testsuite would start to work using your patch.

It built fine and your attached tests in the patch runs fine for me :slight_smile:

Now something fun this Generic test now works that previously failed:

$ llvm-as < test/CodeGen/Generic/multiple-return-values-cross-block-with-invoke.ll | llc
    .file "<stdin>"

    .text
    .globl foo
    .align 2
foo:
    stmfd sp!, {r4, r5, lr}
    mov r4, r1
    mov r5, r0
    bl wild
.LBB1_1: @ normal
    stmia r5, {r0, r1}
    stmia r4, {r2, r3}
    ldmfd sp!, {r4, r5, pc}
    .size foo, .-foo

Some failing tests have now gotten better error reporting than before:

$ llvm-as < test/CodeGen/Generic/select-cc.ll | llc
Formal argument #0 has unhandled type i64
Stack dump:
0. Program arguments: llc
1. Running pass 'ARM Instruction Selection' on function '@vector_select'
Aborted

$ llvm-as < test/CodeGen/X86/dagcombine-buildvector.ll | llc
Formal argument #1 has unhandled type i64
Stack dump:
0. Program arguments: llc
1. Running pass 'ARM Instruction Selection' on function '@test'
Aborted

I have tested this on a overo-earth ti omap3 hardware
Linux overo 2.6.28-omap1 #1 Mon Mar 2 08:40:39 PST 2009 armv7l unknown

Cheers, and have a great day!
Xerxes

Sandeep Patel skrev:

Den 2009-04-16 13:37, Xerxes Rånby skrev:

Some failing tests have now gotten better error reporting than before:

$ llvm-as< test/CodeGen/Generic/select-cc.ll | llc
Formal argument #0 has unhandled type i64
Stack dump:
0. Program arguments: llc
1. Running pass 'ARM Instruction Selection' on function '@vector_select'
Aborted

$ llvm-as< test/CodeGen/X86/dagcombine-buildvector.ll | llc
Formal argument #1 has unhandled type i64
Stack dump:
0. Program arguments: llc
1. Running pass 'ARM Instruction Selection' on function '@test'
Aborted
   
These two test succeeds after applying the attached patch from pr 3898
3898 – Incomplete breakdown of soft-float vectors

[xranby@pusspuss llvm]$ llvm-as < test/CodeGen/Generic/select-cc.ll | llc -march=arm
     .file "<stdin>"

     .text
     .globl vector_select
     .align 2
vector_select:
     stmfd sp!, {r4, r5, r6, r7, lr}
     mov r4, r3
     mov r5, r2
     mov r6, r1
     mov r7, r0
     mov r2, #0
     mov r3, #0
     bl __gedf2
     ldr r2, [sp, #+32]
     cmp r0, #0
     mov r3, r4
     movge r3, r2
     ldr r1, [sp, #+28]
     cmp r0, #0
     mov r2, r5
     movge r2, r1
     ldr r12, [sp, #+24]
     cmp r0, #0
     mov r1, r6
     movge r1, r12
     ldr r12, [sp, #+20]
     cmp r0, #0
     mov r0, r7
     movge r0, r12
     ldmfd sp!, {r4, r5, r6, r7, pc}
     .size vector_select, .-vector_select

[xranby@pusspuss llvm]$ llvm-as < test/CodeGen/X86/dagcombine-buildvector.ll | llc -march=arm
     .file "<stdin>"

     .text
     .globl test
     .align 2
test:
     ldr r1, [sp, #+12]
     str r1, [r0, #+12]
     ldr r1, [sp, #+8]
     str r1, [r0, #+8]
     stmia r0, {r2, r3}
     bx lr
     .size test, .-test

[xranby@pusspuss llvm]$

Thanks Jakob!

Cheers, and have a great day!
Xerxes

After wasting an inordinate amount of time trying to get test-suite to
run on arm-apple-darwin so I could reproduce your results, attached is
a patch that fixes the small copy&paste error of having 8-byte
alignment for stack-allocated f64s instead of the proper 4-byte. I've
updated the patch to the top of trunk changes as well.

Thanks for doing the hard work! Can you document your journey somewhere? :slight_smile:

Bob, can you review Deep's patch and commit it for him?

Thanks,

Evan

Done! Sandeep, this is really a great change. I had seen the discussion of it but hadn't looked at the details until now. Thanks a lot for contributing this.

While I was reviewing it, I found some a few small nit-picky things to clean up (mostly in comments and whitespace). Sorry -- I'm a bit compulsive that way! I will commit those changes in a few minutes. Other than those very minor things, your change looks great.

Your edits are more than welcome, of course.

Two spaces after a period? I thought that went out of fashion with typewriters.

deep