Skip to content

Commit fd64049

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

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
@@ -2650,7 +2650,7 @@ SDValue DAGCombiner::visitPTRADD(SDNode *N) {
26502650
return N0;
26512651

26522652
// fold (ptradd 0, x) -> x
2653-
if (isNullConstant(N0))
2653+
if (isNullConstant(N0) && PtrVT == IntVT)
26542654
return N1;
26552655

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

0 commit comments

Comments
 (0)