Skip to content

Commit 53e9d32

Browse files
authored
DAG: Remove unnecessary getPointerTy call (#154055)
getValueType already did this
1 parent 8f98529 commit 53e9d32

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,11 +1837,8 @@ SDValue SelectionDAGBuilder::getValueImpl(const Value *V) {
18371837
getValue(CPA->getDiscriminator()));
18381838
}
18391839

1840-
if (isa<ConstantPointerNull>(C)) {
1841-
unsigned AS = V->getType()->getPointerAddressSpace();
1842-
return DAG.getConstant(0, getCurSDLoc(),
1843-
TLI.getPointerTy(DAG.getDataLayout(), AS));
1844-
}
1840+
if (isa<ConstantPointerNull>(C))
1841+
return DAG.getConstant(0, getCurSDLoc(), VT);
18451842

18461843
if (match(C, m_VScale()))
18471844
return DAG.getVScale(getCurSDLoc(), VT, APInt(VT.getSizeInBits(), 1));

0 commit comments

Comments
 (0)