Handle it the same as ptrtoint. For ptrtoaddr the resulting integer size is guaranteed to match the address size. For the case where address size and pointer size match, this will be a no-op. For the case where the address size is smaller than the pointer size, this will be a truncate (but this is not testable with in-tree targets).
12 lines
360 B
LLVM
12 lines
360 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc -mtriple=x86_64-linux-gnu -fast-isel -fast-isel-abort=1 < %s -o - | FileCheck %s
|
|
|
|
define i64 @ptrtoaddr(ptr %p) {
|
|
; CHECK-LABEL: ptrtoaddr:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: movq %rdi, %rax
|
|
; CHECK-NEXT: retq
|
|
%addr = ptrtoaddr ptr %p to i64
|
|
ret i64 %addr
|
|
}
|