Guest User

Untitled

a guest
Dec 17th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. // gcc -m32 -S -O2 testra.c
  2. extern __attribute__((fastcall)) void bar0(int);
  3. extern __attribute__((fastcall)) void bar1(int, int);
  4. extern __attribute__((fastcall)) void bar2(int, int);
  5. extern __attribute__((fastcall)) int bar3(int, int);
  6. void __attribute__((fastcall)) foo(int a, int b) {
  7. int c = a * b;
  8. int d = bar3(a, b);
  9. bar0(c);
  10. bar1(a, c);
  11. bar2(b, c);
  12. bar2(b, d);
  13. bar2(a, d);
  14. }
  15. /*
  16. which shows (with d spilled, and r89 is d):
  17. ********** Inheritance #1: **********
  18.  
  19. EBB 2
  20. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  21. Creating newreg=93 from oldreg=89, assigning class GENERAL_REGS to inheritance r93
  22. Original reg change 89->93 (bb2):
  23. 24: dx:SI=r93:SI
  24. Add inheritance<-original before:
  25. 38: r93:SI=r89:SI
  26.  
  27. Inheritance reuse change 89->93 (bb2):
  28. 28: dx:SI=r93:SI
  29. REG_DEAD r93:SI
  30. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  31. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  32. Creating newreg=94 from oldreg=89, assigning class GENERAL_REGS to inheritance r94
  33. Original reg change 89->94 (bb2):
  34. 12: r94:SI=ax:SI
  35. REG_DEAD ax:SI
  36. Add original<-inheritance after:
  37. 39: r89:SI=r94:SI
  38.  
  39. Inheritance reuse change 89->94 (bb2):
  40. 38: r93:SI=r94:SI
  41. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  42. Removing dead insn:
  43. 39: r89:SI=r94:SI
  44. deleting insn with uid = 39.
  45. ...
  46. ********** Assignment #1: **********
  47.  
  48. Assigning to 92 (cl=GENERAL_REGS, orig=88, freq=3000, tfirst=92, tfreq=3000)...
  49. Assign 6 to reload r92 (freq=3000)
  50. Assigning to 93 (cl=GENERAL_REGS, orig=89, freq=3000, tfirst=93, tfreq=3000)...
  51. Assign 6 to inheritance r93 (freq=3000)
  52. Hard reg 0 is preferable by r94 with profit 1000
  53. Hard reg 6 is preferable by r94 with profit 1000
  54. Assigning to 94 (cl=GENERAL_REGS, orig=89, freq=2000, tfirst=93, tfreq=3000)...
  55. Reassigning non-reload pseudos
  56.  
  57. ********** Undoing inheritance #1: **********
  58.  
  59. Inherit 1 out of 2 (50.00%)
  60. Insn after restoring regs:
  61. 38: r93:SI=r89:SI
  62. REG_DEAD r89:SI
  63. Insn after restoring regs:
  64. 12: r89:SI=ax:SI
  65. REG_DEAD ax:SI
  66. */
Add Comment
Please, Sign In to add comment