[llvm-commits] [llvm] r103881 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/mul_const.ll
Jakob Stoklund Olesen
stoklund at 2pi.dk
Sat May 15 17:36:47 PDT 2010
On May 15, 2010, at 4:37 PM, Evan Cheng wrote:
> Hi Anton,
>
> Please move it to general dag combiner for all power of two cases. Special casing for 3, 5, 7, 9 is fairly ugly. Jakob, I think you have a dag combine patch for this? It wasn't profitable for x86, but perhaps it's good for other targets.
Nope, I have an X86 patch. Many factors involve LEA, and it is not easy to imagine a target independent algorithm.
AMD has suggested instruction sequences for factors 2-31 in ยง8.2:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/25112.PDF
A lot of them are shl+add and shl+sub which could be target independent, I guess. All of the power-of-two's are straight shl's, except for 2 which is better done with an add.
/jakob
More information about the llvm-commits
mailing list