[PATCH][PR16882] Ignore noreturn definitions when setting isPhysRegUsed.
qcolombet at apple.com
Tue Sep 24 10:48:38 PDT 2013
On Sep 17, 2013, at 10:54 AM, Quentin Colombet <qcolombet at apple.com> wrote:
> On Sep 10, 2013, at 10:54 AM, Quentin Colombet <qcolombet at apple.com> wrote:
>> On Sep 3, 2013, at 2:16 PM, Quentin Colombet <qcolombet at apple.com> wrote:
>>> The proposed patch fixes PR16882: http://llvm.org/bugs/show_bug.cgi?id=16882.
>>> PR16882 reports a poor code generation issue where we were saving the link register before a call to a noreturn function, whereas it is not needed.
>>> Thanks for your reviews.
>>> ** Details **
>>> PEI inserts a save/restore sequence for the link register, according to the information it gets from the MachineRegisterInfo.
>>> MachineRegisterInfo is populated by the VirtRegMap pass.
>>> This pass was not aware of noreturn calls and was registering the definitions of these calls the same way as regular operations.
>>> ** Proposed Solution **
>>> Modify VirtRegPass so that it does not set the isPhysRegUsed information for registers only defined by noreturn calls.
>>> The rational is that a noreturn call is the "last instruction" of the program (if it returns the behavior is undefined), so everything that is defined by it cannot be used and will not interfere with anything else. Therefore, it is pointless to account for then.
>>> ** Experiments **
>>> I have made functional tests on x86_64 with O3 -fomit-frame-pointer on the llvm test-suite + SPEC.
>>> I did the same for ARMv7s.
>>> I have attached the performance numbers for ARMv7s (lower is better). These numbers only reports benches where the patch kicks in and the test runs for more than 1s (to avoid noise).
>>> The Reference column is LLVM r189613 and Test column is LLVM r189613 + the proposed patch.
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits