File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -1020,7 +1020,7 @@ class MachineRegisterInfo {
1020
1020
return LiveIns;
1021
1021
}
1022
1022
1023
- bool isLiveIn (Register Reg) const ;
1023
+ bool isLiveIn (Register Reg, bool CheckForSubreg = false ) const ;
1024
1024
1025
1025
// / getLiveInPhysReg - If VReg is a live-in virtual register, return the
1026
1026
// / corresponding live-in physical register.
Original file line number Diff line number Diff line change @@ -447,10 +447,22 @@ void MachineRegisterInfo::clearKillFlags(Register Reg) const {
447
447
MO.setIsKill (false );
448
448
}
449
449
450
- bool MachineRegisterInfo::isLiveIn (Register Reg) const {
451
- for (const std::pair<MCRegister, Register> &LI : liveins ())
450
+ bool MachineRegisterInfo::isLiveIn (Register Reg, bool CheckForSubreg ) const {
451
+ for (const std::pair<MCRegister, Register> &LI : liveins ()) {
452
452
if ((Register)LI.first == Reg || LI.second == Reg)
453
453
return true ;
454
+
455
+ // Check if Reg is a subreg of live-in register
456
+ if (CheckForSubreg) {
457
+ MCRegister PhysReg = LI.first ;
458
+ if (!PhysReg.isValid ())
459
+ continue ;
460
+
461
+ for (MCPhysReg SubReg : getTargetRegisterInfo ()->subregs (PhysReg))
462
+ if (SubReg == Reg)
463
+ return true ;
464
+ }
465
+ }
454
466
return false ;
455
467
}
456
468
You can’t perform that action at this time.
0 commit comments