inline-intrinsic-assert.ll 705 B

123456789101112131415161718192021222324252627282930
  1. ; RUN: opt < %s -inline -instcombine -S | FileCheck %s
  2. ; PR22857: http://llvm.org/bugs/show_bug.cgi?id=22857
  3. ; The inliner should not add an edge to an intrinsic and
  4. ; then assert that it did not add an edge to an intrinsic!
  5. define float @foo(float %f1) #0 {
  6. %call = call float @bar(float %f1)
  7. ret float %call
  8. ; CHECK-LABEL: @foo(
  9. ; CHECK-NEXT: call float @llvm.fabs.f32
  10. ; CHECK-NEXT: ret float
  11. }
  12. define float @bar(float %f1) #0 {
  13. %call = call float @sqr(float %f1)
  14. %call1 = call float @sqrtf(float %call) #0
  15. ret float %call1
  16. }
  17. define float @sqr(float %f) #0 {
  18. %mul = fmul fast float %f, %f
  19. ret float %mul
  20. }
  21. declare float @sqrtf(float) #0
  22. attributes #0 = { "unsafe-fp-math"="true" }