Skip to content

Commit a95676c

Browse files
committed
Use C++ comments, don
't use getTypeForEVT, remove const Signed-off-by: John Lu <[email protected]>
1 parent 179869c commit a95676c

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14906,20 +14906,18 @@ SDValue DAGCombiner::reduceLoadWidth(SDNode *N) {
1490614906
if (ExtType == ISD::NON_EXTLOAD) {
1490714907
const MDNode *OldRanges = LN0->getRanges();
1490814908
const MDNode *NewRanges = nullptr;
14909-
/* If LSBs are loaded and the truncated ConstantRange for the OldRanges
14910-
metadata is not the full-set for the NewWidth then create a NewRanges
14911-
metadata for the truncated load */
14909+
// If LSBs are loaded and the truncated ConstantRange for the OldRanges
14910+
// metadata is not the full-set for the NewWidth then create a NewRanges
14911+
// metadata for the truncated load
1491214912
if (ShAmt == 0 && OldRanges) {
14913-
Type *NewTy = VT.getTypeForEVT(*DAG.getContext());
14914-
const unsigned NewWidth = NewTy->getIntegerBitWidth();
14915-
const ConstantRange CR = getConstantRangeFromMetadata(*OldRanges);
14916-
const ConstantRange TruncatedCR = CR.truncate(NewWidth);
14913+
ConstantRange CR = getConstantRangeFromMetadata(*OldRanges);
14914+
ConstantRange TruncatedCR = CR.truncate(VT.getScalarSizeInBits());
1491714915

1491814916
if (!TruncatedCR.isFullSet()) {
1491914917
Metadata *Bounds[2] = {ConstantAsMetadata::get(ConstantInt::get(
14920-
NewTy, TruncatedCR.getLower())),
14918+
*DAG.getContext(), TruncatedCR.getLower())),
1492114919
ConstantAsMetadata::get(ConstantInt::get(
14922-
NewTy, TruncatedCR.getUpper()))};
14920+
*DAG.getContext(), TruncatedCR.getUpper()))};
1492314921
NewRanges = MDNode::get(*DAG.getContext(), Bounds);
1492414922
}
1492514923
}

0 commit comments

Comments
 (0)