optnone-opt.ll 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. ; RUN: opt -S -debug %s 2>&1 | FileCheck %s --check-prefix=OPT-O0
  2. ; RUN: opt -O1 -S -debug %s 2>&1 | FileCheck %s --check-prefix=OPT-O1
  3. ; RUN: opt -O2 -S -debug %s 2>&1 | FileCheck %s --check-prefix=OPT-O1 --check-prefix=OPT-O2O3
  4. ; RUN: opt -O3 -S -debug %s 2>&1 | FileCheck %s --check-prefix=OPT-O1 --check-prefix=OPT-O2O3
  5. ; RUN: opt -bb-vectorize -dce -die -loweratomic -S -debug %s 2>&1 | FileCheck %s --check-prefix=OPT-MORE
  6. ; RUN: opt -indvars -licm -loop-deletion -loop-extract -loop-idiom -loop-instsimplify -loop-reduce -loop-reroll -loop-rotate -loop-unroll -loop-unswitch -S -debug %s 2>&1 | FileCheck %s --check-prefix=OPT-LOOP
  7. ; REQUIRES: asserts
  8. ; This test verifies that we don't run target independent IR-level
  9. ; optimizations on optnone functions.
  10. ; Function Attrs: noinline optnone
  11. define i32 @_Z3fooi(i32 %x) #0 {
  12. entry:
  13. %x.addr = alloca i32, align 4
  14. store i32 %x, i32* %x.addr, align 4
  15. br label %while.cond
  16. while.cond: ; preds = %while.body, %entry
  17. %0 = load i32, i32* %x.addr, align 4
  18. %dec = add nsw i32 %0, -1
  19. store i32 %dec, i32* %x.addr, align 4
  20. %tobool = icmp ne i32 %0, 0
  21. br i1 %tobool, label %while.body, label %while.end
  22. while.body: ; preds = %while.cond
  23. br label %while.cond
  24. while.end: ; preds = %while.cond
  25. ret i32 0
  26. }
  27. attributes #0 = { optnone noinline }
  28. ; Nothing that runs at -O0 gets skipped.
  29. ; OPT-O0-NOT: Skipping pass
  30. ; IR passes run at -O1 and higher.
  31. ; OPT-O1-DAG: Skipping pass 'Aggressive Dead Code Elimination'
  32. ; OPT-O1-DAG: Skipping pass 'Combine redundant instructions'
  33. ; OPT-O1-DAG: Skipping pass 'Dead Store Elimination'
  34. ; OPT-O1-DAG: Skipping pass 'Early CSE'
  35. ; OPT-O1-DAG: Skipping pass 'Jump Threading'
  36. ; OPT-O1-DAG: Skipping pass 'MemCpy Optimization'
  37. ; OPT-O1-DAG: Skipping pass 'Reassociate expressions'
  38. ; OPT-O1-DAG: Skipping pass 'Simplify the CFG'
  39. ; OPT-O1-DAG: Skipping pass 'Sparse Conditional Constant Propagation'
  40. ; OPT-O1-DAG: Skipping pass 'SROA'
  41. ; OPT-O1-DAG: Skipping pass 'Tail Call Elimination'
  42. ; OPT-O1-DAG: Skipping pass 'Value Propagation'
  43. ; Additional IR passes run at -O2 and higher.
  44. ; OPT-O2O3-DAG: Skipping pass 'Global Value Numbering'
  45. ; OPT-O2O3-DAG: Skipping pass 'SLP Vectorizer'
  46. ; Additional IR passes that opt doesn't turn on by default.
  47. ; OPT-MORE-DAG: Skipping pass 'Basic-Block Vectorization'
  48. ; OPT-MORE-DAG: Skipping pass 'Dead Code Elimination'
  49. ; OPT-MORE-DAG: Skipping pass 'Dead Instruction Elimination'
  50. ; OPT-MORE-DAG: Skipping pass 'Lower atomic intrinsics
  51. ; Loop IR passes that opt doesn't turn on by default.
  52. ; OPT-LOOP-DAG: Skipping pass 'Delete dead loops'
  53. ; OPT-LOOP-DAG: Skipping pass 'Extract loops into new functions'
  54. ; OPT-LOOP-DAG: Skipping pass 'Induction Variable Simplification'
  55. ; OPT-LOOP-DAG: Skipping pass 'Loop Invariant Code Motion'
  56. ; OPT-LOOP-DAG: Skipping pass 'Loop Strength Reduction'
  57. ; OPT-LOOP-DAG: Skipping pass 'Recognize loop idioms'
  58. ; OPT-LOOP-DAG: Skipping pass 'Reroll loops'
  59. ; OPT-LOOP-DAG: Skipping pass 'Rotate Loops'
  60. ; OPT-LOOP-DAG: Skipping pass 'Simplify instructions in loops'
  61. ; OPT-LOOP-DAG: Skipping pass 'Unroll loops'
  62. ; OPT-LOOP-DAG: Skipping pass 'Unswitch loops'