Great Indian Bison via llvm-dev
2021-Feb-14 04:53 UTC
[llvm-dev] Check for isConstantPhysReg() in bool LiveRangeCalc::findReachingDefs
Hello LLVMDevs, Should following code in bool LiveRangeCalc::findReachingDefs() check for isConstantPhysReg()? Or there is a code which should prevent error below to hit for constant physical register? 2 if (Register::isPhysicalRegister(PhysReg) && !MBB->isLiveIn(PhysReg)) { 1 MBB->getParent()->verify(); 225 const TargetRegisterInfo *TRI = MRI->getTargetRegisterInfo(); 1 errs() << "The register " << printReg(PhysReg, TRI) 2 << " needs to be live in to " << printMBBReference(*MBB) 3 << ", but is missing from the live-in list.\n"; 4 report_fatal_error("Invalid global physical register"); 5 } Thanks! GI Bison. Sent with [ProtonMail](https://protonmail.com) Secure Email. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210214/5344249c/attachment.html>
Björn Pettersson A via llvm-dev
2021-Feb-14 16:24 UTC
[llvm-dev] Check for isConstantPhysReg() in bool LiveRangeCalc::findReachingDefs
> -----Original Message----- > From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Great > Indian Bison via llvm-dev > Sent: den 14 februari 2021 05:53 > To: llvm-dev at lists.llvm.org > Subject: [llvm-dev] Check for isConstantPhysReg() in bool > LiveRangeCalc::findReachingDefs > > Hello LLVMDevs, > Should following code in bool LiveRangeCalc::findReachingDefs() check for > isConstantPhysReg()? > Or there is a code which should prevent error below to hit for constant > physical register?Not sure, but maybe it is assumed that a constant physical register also should be defined as being "reserved". And if I recall it correctly liveness isn't calculated for reserved registers.> > 2 if (Register::isPhysicalRegister(PhysReg) && !MBB- > >isLiveIn(PhysReg)) { > 1 MBB->getParent()->verify(); > 225 const TargetRegisterInfo *TRI = MRI->getTargetRegisterInfo(); > 1 errs() << "The register " << printReg(PhysReg, TRI) > 2 << " needs to be live in to " << printMBBReference(*MBB) > 3 << ", but is missing from the live-in list.\n"; > 4 report_fatal_error("Invalid global physical register"); > 5 } > > Thanks! > GI Bison. > > > Sent with https://protonmail.com Secure Email.