PROBLEMS 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. 3. When find_reloads is used to count number of spills needed
  2. it does not take into account the fact that a reload may
  3. turn out to be a dummy.
  4. I'm not sure this really happens any more. Doesn't it find
  5. all the dummies on both passes?
  6. 10. movl a3@,a0
  7. movl a3@(16),a1
  8. clrb a0@(a1:l)
  9. is generated and may be worse than
  10. movl a3@,a0
  11. addl a3@(16),a0
  12. clrb a0@
  13. If ordering of operands is improved, many more
  14. such cases will be generated from typical array accesses.
  15. 23. (memory >> 24) and (memory >> 24) == CONST optimizations
  16. ought to be done machine independently.
  17. 38. Hack expand_mult so that if there is no same-modes multiply
  18. it will use a widening multiply and then truncate rather than
  19. calling the library.
  20. 39. Hack expanding of division to notice cases for
  21. long -> short division.
  22. 40. Represent divide insns as (DIV:SI ...) followed by
  23. a separate lowpart extract. Represent remainder insns as DIV:SI
  24. followed by a separate highpart extract. Then cse can work on
  25. the DIV:SI part. Problem is, this may not be desirable on machines
  26. where computing the quotient alone does not necessarily give
  27. a remainder--such as the 68020 for long operands.
  28. 42. In subst in combine.c at line 704 or so, a reg that really
  29. wants an areg gets a dreg. It is i*4, for indexing. Why?
  30. 45. What about reloading DFmode values? Need a block of 2 regs
  31. as one spill. But the 68000 and 68020 have no problems because
  32. they don't ever need to put a DF into ordinary registers and a
  33. DF needs only one FP register.
  34. 48. Often see tstl foo; jeq ...; movl foo,reg
  35. and it would be better perhaps to do movl foo,dreg; jeq ...
  36. In some cases this could make things worse through the
  37. additional constraint on register usage (reg must be available
  38. before the jump and must be a dreg). Also, this is a saving
  39. only if movl sets the cc's, which is a machine-dependent condition
  40. hard to test for.
  41. -optforcemem may solve this problem.
  42. 49. Scheme for making cse work on operations done by library calls:
  43. generate insns for them using a new LIBCALL rtl type, then converting
  44. that during or after cse to actual push and call instructions.
  45. (SET result (LIBCALL:SI (MULT:SI foo bar) "mulsi3"))
  46. No additional temporaries are needed to turn this into
  47. push push call pop store.
  48. 52. Reloading can look at how reload_contents got set up.
  49. If it was copied from a register, just reload from that register.
  50. Otherwise, perhaps can change the previous insn to move the
  51. data via the reload reg, thus avoiding one memory ref.
  52. 53. Know that certain library routines do not clobber memory.
  53. 63. Potential problem in cc_status.value2, if it ever activates itself
  54. after a two-address subtraction (which currently cannot happen).
  55. It is supposed to compare the current value of the destination
  56. but eliminating it would use the results of the subtraction, equivalent
  57. to comparing the previous value of the destination.
  58. 65. Should loops that neither start nor end with a break
  59. be rearranged to end with the last break?
  60. 68. At line 767 of flow.c, we have
  61. (set (reg foo) (ashift 1 (reg bar)))
  62. Local-alloc puts foo and bar both in register 0 since no reason not to.
  63. Later, the shift must be done in another register and the result copied to 0.
  64. It would not need to copy if this insn were 2op'd before local-alloc,
  65. which is possible since one can be sure in advance that this insn will
  66. need a reload.
  67. 69. Define the floating point converting arithmetic instructions
  68. for the 68881.
  69. 74. Combine loop opt with cse opt in one pass. Do cse on each loop,
  70. then loop opt on that loop, and go from innermost loops outward.
  71. Make loop invariants available for cse at end of loop.
  72. 85. pea can force a value to be reloaded into an areg
  73. which can make it worse than separate adding and pushing.
  74. This can only happen for adding something within addql range
  75. and it only loses if the qty becomes dead at that point
  76. so it can be added to with no copying.
  77. 93. If a pseudo doesn't get a hard reg everywhere,
  78. can it get one during a loop?
  79. 95. Can simplify shift of result of a bfextu. See testunsfld.c.
  80. Likewise and of result of a bfextu. See hyph.c.
  81. 96. Can do SImode bitfield insns without reloading, but must
  82. alter the operands in special ways.
  83. 98. Reloading an operand of a compare insn
  84. prevented final from noticing that the compare was redundant.
  85. See hyph.c line 108.
  86. 99. final could check loop-entry branches to see if they
  87. screw up deletion of a test instruction. If they do,
  88. can put another test instruction before the branch and
  89. make it conditional and redirect it.
  90. 101. In cse, stores at addresses that contain SYMBOL_REFS
  91. cannot alias if the symbols are different!
  92. But the symbols may not be explicitly present--they may
  93. be in address registers.
  94. 106. Aliasing may be impossible if data types of refs differ
  95. and data type of containing objects also differ.
  96. (But check this wrt unions.)
  97. 108. Can speed up flow analysis by making a table saying which
  98. register is set and which registers are used by each instruction that
  99. only sets one register and only uses two. This way avoid the tree
  100. walk for such instructions (most instructions).
  101. 109. It is desirable to avoid converting INDEX to SImode if a
  102. narrower mode suffices, as HImode does on the 68000.
  103. How can this be done?
  104. 110. Possible special combination pattern:
  105. If the two operands to a comparison die there and both come from insns
  106. that are identical except for replacing one operand with the other,
  107. throw away those insns. Ok if insns being discarded are known 1 to 1.
  108. An andl #1 after a seq is 1 to 1, but how should compiler know that?