Index: lib/Target/XCore/XCoreRegisterInfo.h =================================================================== --- lib/Target/XCore/XCoreRegisterInfo.h +++ lib/Target/XCore/XCoreRegisterInfo.h @@ -33,6 +33,8 @@ 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; Index: test/CodeGen/XCore/byVal.ll =================================================================== --- test/CodeGen/XCore/byVal.ll +++ test/CodeGen/XCore/byVal.ll @@ -38,13 +38,13 @@ ; 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]