[llvm-commits] [llvm] r103881 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/mul_const.ll
Dale Johannesen
dalej at apple.com
Sun May 16 13:06:53 PDT 2010
On May 16, 2010, at 12:31 PM, Chris Lattner wrote:
> On May 16, 2010, at 10:32 AM, Jakob Stoklund Olesen wrote:
>>
>> But it is not clear that this transform would be a benefit to all
>> targets, and the first one is better than the second for X86
>> because it partially matches an addressing mode.
>
> The best way to handle this IMO is to have target-independent code
> do this, and have TargetLower* expose hooks that the code can query
> for its cost model.
>
> -Chris
I agree (and, fwiw, that's what gcc does). You can do a reasonable
job knowing the relative cycle counts for multiply-by-constant (which
depends on the value of the constant in some hardware), add, sub, and
shift.
More information about the llvm-commits
mailing list