37 lines · plain
1; Check that invalid reductions aren't introduced by deleting2; convergencectrl bundles in convergent functions3;4; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=operand-bundles --test FileCheck --test-arg --check-prefixes=CHECK,INTERESTING --test-arg %s --test-arg --input-file %s -o %t5; RUN: FileCheck --check-prefixes=CHECK,RESULT %s < %t6 7; CHECK-LABEL: define float @convergentctrl_one_interesting(8; INTERESTING: %interesting = call float @convergent.extern.func(9; RESULT: %entry.token = call token @llvm.experimental.convergence.entry()10; RESULT: %interesting = call float @convergent.extern.func(float %x) [ "convergencectrl"(token %entry.token) ]11; RESULT: %boring = call float @convergent.extern.func(float %x) [ "convergencectrl"(token %entry.token) ]12define float @convergentctrl_one_interesting(float %x, float %y) #0 {13 %entry.token = call token @llvm.experimental.convergence.entry()14 %interesting = call float @convergent.extern.func(float %x) [ "convergencectrl"(token %entry.token) ]15 %boring = call float @convergent.extern.func(float %x) [ "convergencectrl"(token %entry.token) ]16 %add = fadd float %interesting, %boring17 ret float %add18}19 20; In theory we could remove the bundle here, since all convergencectrl21; in the function will be removed.22 23; CHECK-LABEL: define float @convergentctrl_can_remove_all(24; RESULT: %entry.token = call token @llvm.experimental.convergence.entry()25; RESULT: %val = call float @convergent.extern.func(float %x) [ "convergencectrl"(token %entry.token) ]26define float @convergentctrl_can_remove_all(float %x, float %y) #0 {27 %entry.token = call token @llvm.experimental.convergence.entry()28 %val = call float @convergent.extern.func(float %x) [ "convergencectrl"(token %entry.token) ]29 ret float %val30}31 32declare float @convergent.extern.func(float) #033declare token @llvm.experimental.convergence.entry() #134 35attributes #0 = { convergent }36attributes #1 = { convergent nocallback nofree nosync nounwind willreturn memory(none) }37