[llvm] r328333 - [Hexagon] Copy subregisters in HexagonStoreWiden
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 23 10:22:56 PDT 2018
Author: kparzysz
Date: Fri Mar 23 10:22:55 2018
New Revision: 328333
URL: http://llvm.org/viewvc/llvm-project?rev=328333&view=rev
Log:
[Hexagon] Copy subregisters in HexagonStoreWiden
When converting an instruction to the wider version, copy any
subregisters if the original operand has a subregister.
Patch by Brendon Cahoon.
Modified:
llvm/trunk/lib/Target/Hexagon/HexagonStoreWidening.cpp
Modified: llvm/trunk/lib/Target/Hexagon/HexagonStoreWidening.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonStoreWidening.cpp?rev=328333&r1=328332&r2=328333&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonStoreWidening.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonStoreWidening.cpp Fri Mar 23 10:22:55 2018
@@ -433,10 +433,11 @@ bool HexagonStoreWidening::createWideSto
const MCInstrDesc &StD = TII->get(WOpc);
MachineOperand &MR = FirstSt->getOperand(0);
int64_t Off = FirstSt->getOperand(1).getImm();
- MachineInstr *StI = BuildMI(*MF, DL, StD)
- .addReg(MR.getReg(), getKillRegState(MR.isKill()))
- .addImm(Off)
- .addImm(Val);
+ MachineInstr *StI =
+ BuildMI(*MF, DL, StD)
+ .addReg(MR.getReg(), getKillRegState(MR.isKill()), MR.getSubReg())
+ .addImm(Off)
+ .addImm(Val);
StI->addMemOperand(*MF, NewM);
NG.push_back(StI);
} else {
@@ -455,10 +456,11 @@ bool HexagonStoreWidening::createWideSto
const MCInstrDesc &StD = TII->get(WOpc);
MachineOperand &MR = FirstSt->getOperand(0);
int64_t Off = FirstSt->getOperand(1).getImm();
- MachineInstr *StI = BuildMI(*MF, DL, StD)
- .addReg(MR.getReg(), getKillRegState(MR.isKill()))
- .addImm(Off)
- .addReg(VReg, RegState::Kill);
+ MachineInstr *StI =
+ BuildMI(*MF, DL, StD)
+ .addReg(MR.getReg(), getKillRegState(MR.isKill()), MR.getSubReg())
+ .addImm(Off)
+ .addReg(VReg, RegState::Kill);
StI->addMemOperand(*MF, NewM);
NG.push_back(StI);
}
More information about the llvm-commits
mailing list