https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60172

--- Comment #16 from Thomas Preud'homme <thomas.preudhomme at arm dot com> ---
Hi Richard,

could you expand on what you said in comment #13? I don't see how reassoc could
help cse here. From what I understood, reassoc tries to group per rank. In our
case, we have (view of the source with loop unrolling):

Arr_2_Par_Ref [Int_Loc] [Int_Loc] = Int_Loc;
/* some stmts */
Arr_2_Par_Ref [Int_Loc+10] [Int_Loc] = Arr_1_Par_Ref [Int_Loc];

If I'm not mistaken, in the first case you'd have:

Int_Loc * 4
Int_Loc * 100
Arr_2_Par_Ref

that would be added together with several statements. However in the second
case you'd have:

Int_Loc * 4
Int_Loc * 100
1000
Arr_2_Par_Ref

that would be added together with several statements. I don't see how could
1000 being added first or last, it seems to me that it's always going to be in
an intermediate statement and thus not all redanduncy would be eliminated by
CSE.

Please let me know if my reasonning is flawed so that I can progress toward a
solution.

Reply via email to