Skip to content

Commit fb877c1

Browse files
committed
[X86] combineLoad - don't bother truncating the alternative target constant data. NFC.
We only iterate over the original target constant/undef width, so keep the alternative data in its original form. This should help if we try to merge constant data in the future.
1 parent 3eaed9e commit fb877c1

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49946,12 +49946,10 @@ static SDValue combineLoad(SDNode *N, SelectionDAG &DAG,
4994649946
}
4994749947
auto MatchingBits = [](const APInt &Undefs, const APInt &UserUndefs,
4994849948
ArrayRef<APInt> Bits, ArrayRef<APInt> UserBits) {
49949-
if (!UserUndefs.isSubsetOf(Undefs))
49950-
return false;
4995149949
for (unsigned I = 0, E = Undefs.getBitWidth(); I != E; ++I) {
4995249950
if (Undefs[I])
4995349951
continue;
49954-
if (Bits[I] != UserBits[I])
49952+
if (UserUndefs[I] || Bits[I] != UserBits[I])
4995549953
return false;
4995649954
}
4995749955
return true;
@@ -49970,8 +49968,6 @@ static SDValue combineLoad(SDNode *N, SelectionDAG &DAG,
4997049968
if (getTargetConstantBitsFromNode(SDValue(N, 0), 8, Undefs, Bits) &&
4997149969
getTargetConstantBitsFromNode(SDValue(User, 0), 8, UserUndefs,
4997249970
UserBits)) {
49973-
UserUndefs = UserUndefs.trunc(Undefs.getBitWidth());
49974-
UserBits.truncate(Bits.size());
4997549971
if (MatchingBits(Undefs, UserUndefs, Bits, UserBits)) {
4997649972
SDValue Extract = extractSubVector(
4997749973
SDValue(User, 0), 0, DAG, SDLoc(N), RegVT.getSizeInBits());

0 commit comments

Comments
 (0)