Warning: Unused variable
UnderwoodJM opened this issue · comments
When compiling currently we have an unused variable. It seems prologue and epilogue don't use Instruction Info. NOPE not that function.
/home/developer/Projects/llvm-nope/llvm/lib/Target/PIC16/PIC16FrameLowering.cpp:214:26: warning: unused variable 'TII' [-Wunused-variable]
const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo();
^
/home/developer/Projects/llvm-nope/llvm/lib/Target/PIC16/PIC16FrameLowering.cpp:233:26: warning: unused variable 'TII' [-Wunused-variable]
const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo();
that's really weird that you're getting this warning.
Here is a code snippet from prologue:
BuildMI(MBB, MBBI, DL, TII.get(PIC16::INCF_F))
.addReg(PIC16::SP);
BuildMI(MBB, MBBI, DL, TII.get(PIC16::MOVF_W), PIC16::SP);
BuildMI(MBB, MBBI, DL, TII.get(PIC16::MOVWF))
.addReg(PIC16::FSR);
BuildMI(MBB, MBBI, DL, TII.get(PIC16::MOVF_W))
.addReg(PIC16::FP);
BuildMI(MBB, MBBI, DL, TII.get(PIC16::MOVWF))
.addReg(PIC16::INDF);
BuildMI(MBB, MBBI, DL, TII.get(PIC16::INCF_F), PIC16::SP);
BuildMI(MBB, MBBI, DL, TII.get(PIC16::MOVF_W), PIC16::SP);
BuildMI(MBB, MBBI, DL, TII.get(PIC16::MOVWF), PIC16::FP);
BuildMI(MBB, MBBI, DL, TII.get(PIC16::DECF_F), PIC16::FP);
BuildMI(MBB, MBBI, DL, TII.get(PIC16::DECF_F), PIC16::FP);
There is a very similar pattern in the epilogue.
Looked at the line counts. Disregard earlier comment...
spillCalleeSavedRegisters
and restoreCalleeSavedRegisters
are the offending functions.
Can you remove this or do you want me to do it?
fixed