mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Do pointer cast simplifications on addrspacecast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199254 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1909,5 +1909,5 @@ Instruction *InstCombiner::visitBitCast(BitCastInst &CI) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Instruction *InstCombiner::visitAddrSpaceCast(AddrSpaceCastInst &CI) {
|
Instruction *InstCombiner::visitAddrSpaceCast(AddrSpaceCastInst &CI) {
|
||||||
return commonCastTransforms(CI);
|
return commonPointerCastTransforms(CI);
|
||||||
}
|
}
|
||||||
|
@ -789,4 +789,13 @@ define i16 @test41([3 x i32] addrspace(1)* %array) {
|
|||||||
; CHECK-NEXT: ret i16 8
|
; CHECK-NEXT: ret i16 8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
define i32 addrspace(1)* @ascast_0_gep([128 x i32]* %p) nounwind {
|
||||||
|
; CHECK-LABEL: @ascast_0_gep(
|
||||||
|
; CHECK-NOT: getelementptr
|
||||||
|
; CHECK: ret
|
||||||
|
%gep = getelementptr [128 x i32]* %p, i32 0, i32 0
|
||||||
|
%x = addrspacecast i32* %gep to i32 addrspace(1)*
|
||||||
|
ret i32 addrspace(1)* %x
|
||||||
|
}
|
||||||
|
|
||||||
; CHECK: attributes [[NUW]] = { nounwind }
|
; CHECK: attributes [[NUW]] = { nounwind }
|
||||||
|
Reference in New Issue
Block a user