mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Fix codegen for null different sized pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194932 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2905440bdd
commit
4fe5b640ee
@ -1064,8 +1064,10 @@ SDValue SelectionDAGBuilder::getValueImpl(const Value *V) {
|
|||||||
if (const GlobalValue *GV = dyn_cast<GlobalValue>(C))
|
if (const GlobalValue *GV = dyn_cast<GlobalValue>(C))
|
||||||
return DAG.getGlobalAddress(GV, getCurSDLoc(), VT);
|
return DAG.getGlobalAddress(GV, getCurSDLoc(), VT);
|
||||||
|
|
||||||
if (isa<ConstantPointerNull>(C))
|
if (isa<ConstantPointerNull>(C)) {
|
||||||
return DAG.getConstant(0, TLI->getPointerTy());
|
unsigned AS = V->getType()->getPointerAddressSpace();
|
||||||
|
return DAG.getConstant(0, TLI->getPointerTy(AS));
|
||||||
|
}
|
||||||
|
|
||||||
if (const ConstantFP *CFP = dyn_cast<ConstantFP>(C))
|
if (const ConstantFP *CFP = dyn_cast<ConstantFP>(C))
|
||||||
return DAG.getConstantFP(*CFP, VT);
|
return DAG.getConstantFP(*CFP, VT);
|
||||||
|
@ -40,3 +40,14 @@ entry:
|
|||||||
store i32 %1, i32 addrspace(1)* %out
|
store i32 %1, i32 addrspace(1)* %out
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; CHECK-LABEL: @null_32bit_lds_ptr:
|
||||||
|
; CHECK: V_CMP_NE_I32
|
||||||
|
; CHECK-NOT: V_CMP_NE_I32
|
||||||
|
; CHECK: V_CNDMASK_B32
|
||||||
|
define void @null_32bit_lds_ptr(i32 addrspace(1)* %out, i32 addrspace(3)* %lds) nounwind {
|
||||||
|
%cmp = icmp ne i32 addrspace(3)* %lds, null
|
||||||
|
%x = select i1 %cmp, i32 123, i32 456
|
||||||
|
store i32 %x, i32 addrspace(1)* %out
|
||||||
|
ret void
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user