[llvm] r180193 - MI Sched: eliminate local vreg copies.

Andrew Trick atrick at apple.com
Wed Apr 24 11:30:23 PDT 2013


On Apr 24, 2013, at 11:04 AM, Hal Finkel <hfinkel at anl.gov> wrote:
>> 
>> Added: llvm/trunk/test/CodeGen/ARM/misched-copy-arm.ll
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/misched-copy-arm.ll?rev=180193&view=auto
>> ==============================================================================
>> --- llvm/trunk/test/CodeGen/ARM/misched-copy-arm.ll (added)
>> +++ llvm/trunk/test/CodeGen/ARM/misched-copy-arm.ll Wed Apr 24
>> 10:54:43 2013
>> @@ -0,0 +1,30 @@
>> +; REQUIRES: asserts
>> +; RUN: llc < %s -march=thumb -mcpu=swift -pre-RA-sched=source
>> -enable-misched -verify-misched -debug-only=misched -o - 2>&1 >
>> /dev/null | FileCheck %s
>> +;
>> +; Loop counter copies should be eliminated.
>> +; There is also a MUL here, but we don't care where it is scheduled.
>> +; CHECK: postinc
>> +; CHECK: *** Final schedule for BB#2 ***
>> +; CHECK: t2LDRs
>> +; CHECK: t2ADDrr
>> +; CHECK: t2CMPrr
>> +; CHECK: COPY
> 
> Why can't you disable post-ra scheduling and check the actual output assembly?
> 
> -Hal

That would be preferable if the test were just as strong. I actually added a flag to suppress copy rewriting for this purpose, but it wasn't sufficient for other test cases where I want to know exactly where the scheduler placed the copy even if it is removed later. There are too many places where we rewrite copies.

In this particular test, it's not so bad. I could just check for the nonexistence of mov instructions. However, I also want to test that the output of the coalescer has the copy, otherwise it's a useless test.

I know it's kind of offensive to check stderr, but it seems like the only strong way to unit test certain behavior. I don't have a strong feeling about how scheduler tests should be written, so I'm open to feedback.

-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130424/9b2e3195/attachment.html>


More information about the llvm-commits mailing list