Skip to content

Commit 83ca720

Browse files
authored
PeepholeOpt: Remove check for reg_sequence def of subregister (#124512)
The verifier does not allow reg_sequence to have subregister defs, even if undef.
1 parent 8d506b9 commit 83ca720

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

llvm/lib/CodeGen/PeepholeOptimizer.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,22 +1956,7 @@ ValueTrackerResult ValueTracker::getNextSourceFromRegSequence() {
19561956
assert((Def->isRegSequence() || Def->isRegSequenceLike()) &&
19571957
"Invalid definition");
19581958

1959-
if (Def->getOperand(DefIdx).getSubReg())
1960-
// If we are composing subregs, bail out.
1961-
// The case we are checking is Def.<subreg> = REG_SEQUENCE.
1962-
// This should almost never happen as the SSA property is tracked at
1963-
// the register level (as opposed to the subreg level).
1964-
// I.e.,
1965-
// Def.sub0 =
1966-
// Def.sub1 =
1967-
// is a valid SSA representation for Def.sub0 and Def.sub1, but not for
1968-
// Def. Thus, it must not be generated.
1969-
// However, some code could theoretically generates a single
1970-
// Def.sub0 (i.e, not defining the other subregs) and we would
1971-
// have this case.
1972-
// If we can ascertain (or force) that this never happens, we could
1973-
// turn that into an assertion.
1974-
return ValueTrackerResult();
1959+
assert(!Def->getOperand(DefIdx).getSubReg() && "illegal subregister def");
19751960

19761961
SmallVector<RegSubRegPairAndIdx, 8> RegSeqInputRegs;
19771962
if (!TII->getRegSequenceInputs(*Def, DefIdx, RegSeqInputRegs))

0 commit comments

Comments
 (0)