brintos

brintos / llvm-project-archived public Read only

0
0
Text · 878 B · c4fab0f Raw
41 lines · plain
1; RUN: opt < %s -passes=inline -S | FileCheck %s2 3; InlineCost used to have problems with the ptrtoint, leading to4; crashes when visiting the trunc in pr47969_help and the icmp in5; pr38500_help.6 7target datalayout = "p:16:16"8target triple = "x86_64-unknown-linux-gnu"9 10define void @pr47969_help(ptr %p) {11  %cast = ptrtoint ptr %p to i3212  %sub = sub i32 %cast, %cast13  %conv = trunc i32 %sub to i1614  ret void15}16 17define void @pr47969(ptr %x) {18  call void @pr47969_help(ptr %x)19  ret void20}21 22; CHECK-LABEL: @pr47969(ptr %x)23; CHECK-NOT:     call24; CHECK:         ret void25 26define void @pr38500_help(ptr %p) {27  %cast = ptrtoint ptr %p to i3228  %sub = sub i32 %cast, %cast29  %cmp = icmp eq i32 %sub, 030  ret void31}32 33define void @pr38500(ptr %x) {34  call void @pr38500_help(ptr %x)35  ret void36}37 38; CHECK-LABEL: @pr38500(ptr %x)39; CHECK-NOT:     call40; CHECK:         ret void41