bpf: Use markSuperRegs to mark reserved registers
authorYonghong Song <yhs@fb.com>
Fri, 23 Feb 2018 23:49:18 +0000 (23:49 +0000)
committerYonghong Song <yhs@fb.com>
Fri, 23 Feb 2018 23:49:18 +0000 (23:49 +0000)
markSuperRegs is the canonical helper function used to mark reserved
registers. It could mark any overlapping sub-registers automatically.

Reviewed-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
llvm-svn: 325979

llvm/lib/Target/BPF/BPFRegisterInfo.cpp

index 6f70678..635c111 100644 (file)
@@ -37,8 +37,8 @@ BPFRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
 
 BitVector BPFRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
   BitVector Reserved(getNumRegs());
-  Reserved.set(BPF::R10); // R10 is read only frame pointer
-  Reserved.set(BPF::R11); // R11 is pseudo stack pointer
+  markSuperRegs(Reserved, BPF::W10); // [W|R]10 is read only frame pointer
+  markSuperRegs(Reserved, BPF::W11); // [W|R]11 is pseudo stack pointer
   return Reserved;
 }