http://llvm.org/bugs/show_bug.cgi?id=3574
Summary: missed opt: ptrtoint(inttoptr (a -> b), c) -> sext
Product: new-bugs
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
The following snippet should simplify to an sext on x86_64:
--
ddun...@ozzy:CodeGen$ cat /tmp/t.ll
; ModuleID = '<stdin>'
target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "x86_64-apple-darwin10.0"
define i64 @f0(i32 %a0) nounwind {
%t0 = inttoptr i32 %a0 to i8*
%t1 = ptrtoint i8* %t0 to i64
ret i64 %t1
}
ddun...@ozzy:CodeGen$ llvm-as < /tmp/t.ll | opt -instcombine | llvm-dis
; ModuleID = '<stdin>'
target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "x86_64-apple-darwin10.0"
define i64 @f0(i32 %a0) nounwind {
%t0 = inttoptr i32 %a0 to i8* ; <i8*> [#uses=1]
%t1 = ptrtoint i8* %t0 to i64 ; <i64> [#uses=1]
ret i64 %t1
}
--
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs