Skip to content

Commit 35459d6

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

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

26512651
// fold (ptradd 0, x) -> x
2652-
if (isNullConstant(N0))
2652+
if (isNullConstant(N0) && PtrVT == IntVT)
26532653
return N1;
26542654

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

0 commit comments

Comments
 (0)