optimization-remarks-inline.ll 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. ; RUN: opt < %s -inline -pass-remarks='inline' -S 2>&1 | FileCheck %s
  2. ; RUN: opt < %s -inline -pass-remarks='inl.*' -S 2>&1 | FileCheck %s
  3. ; RUN: opt < %s -inline -pass-remarks='vector' -pass-remarks='inl' -S 2>&1 | FileCheck %s
  4. ; These two should not yield an inline remark for the same reason.
  5. ; In the first command, we only ask for vectorizer remarks, in the
  6. ; second one we ask for the inliner, but we then ask for the vectorizer
  7. ; (thus overriding the first flag).
  8. ; RUN: opt < %s -inline -pass-remarks='vector' -S 2>&1 | FileCheck --check-prefix=REMARKS %s
  9. ; RUN: opt < %s -inline -pass-remarks='inl' -pass-remarks='vector' -S 2>&1 | FileCheck --check-prefix=REMARKS %s
  10. ; RUN: opt < %s -inline -S 2>&1 | FileCheck --check-prefix=REMARKS %s
  11. ; RUN: not opt < %s -pass-remarks='(' 2>&1 | FileCheck --check-prefix=BAD-REGEXP %s
  12. define i32 @foo(i32 %x, i32 %y) #0 {
  13. entry:
  14. %x.addr = alloca i32, align 4
  15. %y.addr = alloca i32, align 4
  16. store i32 %x, i32* %x.addr, align 4
  17. store i32 %y, i32* %y.addr, align 4
  18. %0 = load i32, i32* %x.addr, align 4
  19. %1 = load i32, i32* %y.addr, align 4
  20. %add = add nsw i32 %0, %1
  21. ret i32 %add
  22. }
  23. define i32 @bar(i32 %j) #0 {
  24. entry:
  25. %j.addr = alloca i32, align 4
  26. store i32 %j, i32* %j.addr, align 4
  27. %0 = load i32, i32* %j.addr, align 4
  28. %1 = load i32, i32* %j.addr, align 4
  29. %sub = sub nsw i32 %1, 2
  30. %call = call i32 @foo(i32 %0, i32 %sub)
  31. ; CHECK: foo inlined into bar
  32. ; REMARKS-NOT: foo inlined into bar
  33. ret i32 %call
  34. }
  35. ; BAD-REGEXP: Invalid regular expression '(' in -pass-remarks: