On 2022-02-23 01:30, Segher Boessenkool wrote:
Hi Jiu Fu,

On Tue, Feb 22, 2022 at 02:53:13PM +0800, Jiufu Guo wrote:
 static bool
rs6000_cannot_force_const_mem (machine_mode mode ATTRIBUTE_UNUSED, rtx x)
 {
-  if (GET_CODE (x) == HIGH
-      && GET_CODE (XEXP (x, 0)) == UNSPEC)
+  if (GET_CODE (x) == HIGH)
     return true;

Hi Segher,

This isn't explained anywhere.  "Update" is not enough ;-)
Thanks! I will add explanations for it. This excludes all 'HIGH' for 'x' code,
like function "rs6000_emit_move" also check if the code is 'HIGH'.

And on P10, I also encounter this kind of case like:
(high:DI (symbol_ref:DI ("var_1") [flags 0xc0] <var_decl 0x200000b003f0 var_1>))
Which fail to store into .rodata.



CSE is the pass that is most ancient and still causing problems left and
right.  It should be rewritten sooner rather than later.

The problem with that is that the pass does so much more than just CSE,
and we don't want to lose all those other things.  So it will be a slow
arduous affair of peeling off bits into separate passes, I think :-(

Yes, it does a lot of work. One of the additional works is checking 'folding out
constants and putting constant in memory'.

BR,
Jiufu


Doing actual CSE without all the restrictive restrictions our pass has
historically had isn't the hard part!


Segher

Reply via email to