Skip to content

Commit dbf2104

Browse files
author
git apple-llvm automerger
committed
Merge commit 'ea78bfae78f6' from llvm.org/main into next
2 parents e65bd6a + ea78bfa commit dbf2104

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/FastISel.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1845,7 +1845,8 @@ bool FastISel::selectOperator(const User *I, unsigned Opcode) {
18451845
return selectCast(I, ISD::SINT_TO_FP);
18461846

18471847
case Instruction::IntToPtr: // Deliberate fall-through.
1848-
case Instruction::PtrToInt: {
1848+
case Instruction::PtrToInt:
1849+
case Instruction::PtrToAddr: {
18491850
EVT SrcVT = TLI.getValueType(DL, I->getOperand(0)->getType());
18501851
EVT DstVT = TLI.getValueType(DL, I->getType());
18511852
if (DstVT.bitsGT(SrcVT))
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+
; RUN: llc -mtriple=x86_64-linux-gnu -fast-isel -fast-isel-abort=1 < %s -o - | FileCheck %s
3+
4+
define i64 @ptrtoaddr(ptr %p) {
5+
; CHECK-LABEL: ptrtoaddr:
6+
; CHECK: # %bb.0:
7+
; CHECK-NEXT: movq %rdi, %rax
8+
; CHECK-NEXT: retq
9+
%addr = ptrtoaddr ptr %p to i64
10+
ret i64 %addr
11+
}

0 commit comments

Comments
 (0)