[llvm] r326069 - [XCore] Return true in enableMultipleCopyHints().
Jonas Paulsson via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 26 00:03:32 PST 2018
Author: jonpa
Date: Mon Feb 26 00:03:32 2018
New Revision: 326069
URL: http://llvm.org/viewvc/llvm-project?rev=326069&view=rev
Log:
[XCore] Return true in enableMultipleCopyHints().
Enable multiple COPY hints to eliminate more COPYs during register allocation.
Note that this is something all targets should do, see
https://reviews.llvm.org/D38128.
Review: Robert Lytton
Modified:
llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.h
llvm/trunk/test/CodeGen/XCore/byVal.ll
Modified: llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.h?rev=326069&r1=326068&r2=326069&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.h (original)
+++ llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.h Mon Feb 26 00:03:32 2018
@@ -33,6 +33,8 @@ public:
BitVector getReservedRegs(const MachineFunction &MF) const override;
+ bool enableMultipleCopyHints() const override { return true; }
+
bool requiresRegisterScavenging(const MachineFunction &MF) const override;
bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override;
Modified: llvm/trunk/test/CodeGen/XCore/byVal.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/XCore/byVal.ll?rev=326069&r1=326068&r2=326069&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/XCore/byVal.ll (original)
+++ llvm/trunk/test/CodeGen/XCore/byVal.ll Mon Feb 26 00:03:32 2018
@@ -38,13 +38,13 @@ entry:
; CHECK-LABEL: f2Test
; CHECK: extsp 4
; CHECK: stw lr, sp[1]
+; CHECK: mov r11, r1
; CHECK: stw r2, sp[3]
; CHECK: stw r3, sp[4]
; CHECK: ldw r0, r0[0]
; CHECK: stw r0, sp[2]
-; CHECK: ldaw r2, sp[2]
-; CHECK: mov r0, r1
-; CHECK: mov r1, r2
+; CHECK: ldaw r1, sp[2]
+; CHECK: mov r0, r11
; CHECK: bl f2
; CHECK: ldw lr, sp[1]
; CHECK: ldaw sp, sp[4]
More information about the llvm-commits
mailing list