[PATCH] EABI Divmod Legal
Renato Golin
renato.golin at linaro.org
Mon Sep 2 04:51:39 PDT 2013
Hi t.p.northover, amaury.dlv,
This patch removes the Custom lowering for EABI divmod and teaches the generic lowering about "value_in_regs" for library calls in a *very* conservative way. Apart from the problems listed below, the patch works with all integer types, including 64-bit.
Problems:
1. The way to tell if the lowering is in regs is via TLI.usesRegistersForDivMod(). This is specific to divmod, instead of "isLibCalInRegs()" because different targets can have different library calls in regs. Adding "is<name>LibCallInRegs()" for each library call would be impractical if there were too many. We could use a table in that case.
2. There is a hack on the number of return values for library calls in ExpandLibraryCall which could be better. I'm open to suggestions and pointer from other implementations of the same thing, but I need to be able to choose the number of return values and, if any, which of them I'm actually returning. Without that, the legalization around the call goes bonkers.
http://llvm-reviews.chandlerc.com/D1575
Files:
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMISelLowering.h
test/CodeGen/ARM/divmod-eabi.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1575.1.patch
Type: text/x-patch
Size: 17598 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130902/31ad0cbe/attachment.bin>
More information about the llvm-commits
mailing list