Skip to content

Commit b761471

Browse files
committed
PeepholeOpt: Remove null TargetRegisterInfo check
This cannot happen. Also simplify the LaneBitmask check from !none to any.
1 parent 1042ddc commit b761471

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/CodeGen/PeepholeOptimizer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,9 +2048,9 @@ ValueTrackerResult ValueTracker::getNextSourceFromInsertSubreg() {
20482048
// Get the TRI and check if the inserted sub-register overlaps with the
20492049
// sub-register we are tracking.
20502050
const TargetRegisterInfo *TRI = MRI.getTargetRegisterInfo();
2051-
if (!TRI || !(TRI->getSubRegIndexLaneMask(DefSubReg) &
2052-
TRI->getSubRegIndexLaneMask(InsertedReg.SubIdx))
2053-
.none())
2051+
if ((TRI->getSubRegIndexLaneMask(DefSubReg) &
2052+
TRI->getSubRegIndexLaneMask(InsertedReg.SubIdx))
2053+
.any())
20542054
return ValueTrackerResult();
20552055
// At this point, the value is available in v0 via the same subreg
20562056
// we used for Def.

0 commit comments

Comments
 (0)