File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -980,6 +980,12 @@ class MachineRegisterInfo {
980
980
// / expected.
981
981
bool isReservedRegUnit (unsigned Unit) const ;
982
982
983
+ // / Returns true when the given register unit is considered artificial.
984
+ // /
985
+ // / Register units are considered artificial when at least one of the
986
+ // / root registers is artificial.
987
+ bool isArtificialRegUnit (unsigned Unit) const ;
988
+
983
989
// / isAllocatable - Returns true when PhysReg belongs to an allocatable
984
990
// / register class and it hasn't been reserved.
985
991
// /
Original file line number Diff line number Diff line change @@ -734,12 +734,8 @@ void LiveIntervals::addKillFlags(const VirtRegMap *VRM) {
734
734
for (MCRegUnitMaskIterator UI (PhysReg, TRI); UI.isValid (); ++UI) {
735
735
auto [Unit, Bitmask] = *UI;
736
736
// Record lane mask for all artificial RegUnits for this physreg.
737
- for (MCRegUnitRootIterator Root (Unit, TRI); Root.isValid (); ++Root) {
738
- if (TRI->isArtificial (*Root)) {
739
- ArtificialLanes |= Bitmask;
740
- break ;
741
- }
742
- }
737
+ if (MRI->isArtificialRegUnit (Unit))
738
+ ArtificialLanes |= Bitmask;
743
739
const LiveRange &RURange = getRegUnit (Unit);
744
740
if (RURange.empty ())
745
741
continue ;
Original file line number Diff line number Diff line change @@ -659,3 +659,11 @@ bool MachineRegisterInfo::isReservedRegUnit(unsigned Unit) const {
659
659
}
660
660
return false ;
661
661
}
662
+
663
+ bool MachineRegisterInfo::isArtificialRegUnit (unsigned Unit) const {
664
+ const TargetRegisterInfo *TRI = getTargetRegisterInfo ();
665
+ for (MCRegUnitRootIterator Root (Unit, TRI); Root.isValid (); ++Root)
666
+ if (TRI->isArtificial (*Root))
667
+ return true ;
668
+ return false ;
669
+ }
You can’t perform that action at this time.
0 commit comments