[llvm-commits] [llvm] r56384 - in /llvm/trunk/lib/CodeGen: RegAllocLinearScan.cpp SimpleRegisterCoalescing.cpp

Chris Lattner clattner at apple.com
Mon Sep 22 10:45:34 PDT 2008


On Sep 22, 2008, at 10:38 AM, Chris Lattner wrote:

>>> Can earlyclobber operands be used to model the armv4 "mul" register
>>> weirdness where the input and output regs can't be the same?
>>
>> We could, but the correct way to model it is to push the use down one
>> cycle, not def up one cycle. The problem with early clobber is the  
>> def
>> cannot overlap any of the uses (both Rm and Rs). In the ARM mul case,
>> the def cannot overlap Rm only.
>
> Sure, I agree with that.  This is also true of most inline asms with
> multiple instructions (like the example I gave).  Using earlyclobber
> should be a conservative but correct solution (and much better than
> using the 'multiply fixer' pass that used to exist).
>
> This would also make it easier to test that earlyclobber is working
> right (multiplies are more frequent than & in asms), which is why I
> brought it up. :)

Also, to be perfectly clear, the testing is pretty easy (doesn't rely  
on assembler support): just add asserts to the asmprinter that the  
result isn't the same as any output.  Then just build llvm-test with  
armv4 and see if any asserts come out.  If not, declare that  
earlyclobber works ;-)

-Chris



More information about the llvm-commits mailing list