36 lines · plain
1; RUN: opt -S --passes="ipsccp<func-spec>" -funcspec-for-literal-constant=false < %s | FileCheck %s2define dso_local i32 @p0(i32 noundef %x) {3entry:4 %add = add nsw i32 %x, 15 ret i32 %add6}7 8define dso_local i32 @p1(i32 noundef %x) {9entry:10 %sub = add nsw i32 %x, -111 ret i32 %sub12}13 14define internal fastcc i32 @f(i32 noundef %x, ptr nocapture noundef readonly %p) noinline {15entry:16 %call = tail call i32 %p(i32 noundef %x)17 %add = add nsw i32 %call, %x18 ret i32 %add19}20 21define dso_local i32 @g0(i32 noundef %x) {22entry:23 %call = tail call fastcc i32 @f(i32 noundef %x, ptr noundef nonnull @p0)24 ret i32 %call25}26 27define dso_local i32 @g1(i32 noundef %x) {28entry:29 %call = tail call fastcc i32 @f(i32 noundef %x, ptr noundef nonnull @p1)30 ret i32 %call31}32 33; Check that a noinline function is specialized, even if it's small.34; CHECK: @f.specialized.135; CHECK: @f.specialized.236