mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
InstSimplify: stripAndComputeConstantOffsets can be called with vectors of pointers too.
Prepare it for vectors of pointers and handle simple cases. We don't handle complicated cases because accumulateConstantOffset bails on pointer vectors. Fixes selfhost on i386. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174179 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -46,3 +46,14 @@ define i64 @ptrdiff3(i8* %ptr) {
|
||||
%diff = sub i64 %last.int, %first.int
|
||||
ret i64 %diff
|
||||
}
|
||||
|
||||
define <4 x i32> @ptrdiff4(<4 x i8*> %arg) nounwind {
|
||||
; Handle simple cases of vectors of pointers.
|
||||
; CHECK: @ptrdiff4
|
||||
; CHECK: ret <4 x i32> zeroinitializer
|
||||
%p1 = ptrtoint <4 x i8*> %arg to <4 x i32>
|
||||
%bc = bitcast <4 x i8*> %arg to <4 x i32*>
|
||||
%p2 = ptrtoint <4 x i32*> %bc to <4 x i32>
|
||||
%sub = sub <4 x i32> %p1, %p2
|
||||
ret <4 x i32> %sub
|
||||
}
|
||||
|
Reference in New Issue
Block a user