Skip to content

Commit 267a932

Browse files
committed
Add an explicit PtrVT == IntVT to the (ptradd 0, x) -> x fold
1 parent b905ddf commit 267a932

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2652,7 +2652,7 @@ SDValue DAGCombiner::visitPTRADD(SDNode *N) {
26522652
return N0;
26532653

26542654
// fold (ptradd 0, x) -> x
2655-
if (isNullConstant(N0))
2655+
if (isNullConstant(N0) && PtrVT == IntVT)
26562656
return N1;
26572657

26582658
if (N0.getOpcode() != ISD::PTRADD ||

0 commit comments

Comments
 (0)