aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKelvin Nilsen <kelvin@gcc.gnu.org>2018-09-17 11:52:55 +0000
committerKelvin Nilsen <kelvin@gcc.gnu.org>2018-09-17 11:52:55 +0000
commit9b564998499b1de5cdc611d08fb75d6376e4f064 (patch)
tree24fd0545fdfb0dd75c1ce407776e63be2e3f682c
parentd49541f55e6988b3e818450b41e20af35eebf839 (diff)
checkpoint
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ibm/git280@264366 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/config/rs6000/rs6000-p9indexing.c33
-rw-r--r--gcc/emit-rtl.c6
-rw-r--r--gcc/explow.c2
3 files changed, 35 insertions, 6 deletions
diff --git a/gcc/config/rs6000/rs6000-p9indexing.c b/gcc/config/rs6000/rs6000-p9indexing.c
index 88e3178b4f9..09c631ee2d1 100644
--- a/gcc/config/rs6000/rs6000-p9indexing.c
+++ b/gcc/config/rs6000/rs6000-p9indexing.c
@@ -469,7 +469,12 @@ fixup_equivalences (indexing_web_entry *insn_entry) {
}
}
+ /* I don't want the full generality of:
+
rtx new_mem = replace_equiv_address (mem, derived_ptr_reg, false);
+ */
+ rtx new_mem = gen_rtx_MEM (GET_MODE (mem), derived_ptr_reg);
+ MEM_COPY_ATTRIBUTES (new_mem, mem);
fprintf (dump_file, " after back from replace_equiv_address\n");
print_rtl (dump_file, new_mem);
@@ -519,7 +524,7 @@ fixup_equivalences (indexing_web_entry *insn_entry) {
/* Code works for both 32-bit and 64-bit targets. */
rtx_insn *insn = insn_entry [em->uid].insn;
rtx body = PATTERN (insn);
- rtx addr, mem;
+ rtx mem;
bool is_load;
if (dump_file) {
@@ -535,25 +540,41 @@ fixup_equivalences (indexing_web_entry *insn_entry) {
{
/* propagating instruction is a load */
mem = SET_SRC (body);
- addr = XEXP (SET_SRC (body), 0);
is_load = true;
}
else
{ /* propagating instruction is a store */
gcc_assert (GET_CODE (SET_DEST (body)) == MEM);
mem = SET_DEST (body);
- addr = XEXP (SET_DEST (body), 0);
is_load = false;
}
+ /* In an earlier revision of this code, I had:
+
+ rtx new_mem = replace_equiv_address (mem, addr_expr, false);
+
+ But I found that replace_equiv_address does not
+ work for me, because it is calling force_reg () on my
+ CONST_INT subexpression, and it is not even emitting
+ the code to load the CONST_INT into the
+ pseudo-register that it puts forward to replace the
+ CONST_INT. apparently, there are some assumptions in
+ the implementation of replace_equiv_address that are
+ not valid when it is invoked from this context.
+
+ so instead, i borrowed some of the code that
+ replace_equiv_address uses to copy attribute info...
+ */
rtx ci = gen_rtx_raw_CONST_INT (Pmode, dominated_delta);
rtx addr_expr = gen_rtx_PLUS (Pmode, derived_ptr_reg, ci);
- rtx new_mem = replace_equiv_address (mem, addr_expr, false);
+ rtx new_mem = gen_rtx_MEM (GET_MODE (mem), addr_expr);
+ MEM_COPY_ATTRIBUTES (new_mem, mem);
+#ifdef NO_NOISE
fprintf (dump_file, " after replace_equiv_address, new_mem: ");
print_rtl (dump_file, new_mem);
fprintf (dump_file, "\n");
-
+#endif
rtx new_expr;
if (is_load)
new_expr = gen_rtx_SET (SET_DEST (body), new_mem);
@@ -1462,6 +1483,7 @@ rs6000_fix_indexing (function *fun)
dump_equivalences (insn_entry);
fixup_equivalences (insn_entry);
+#ifdef NOT_NEEDED
if (dump_file) {
/* let's see if i have dominator information here */
for (int i = 0; i < num_equivalences; i++) {
@@ -1491,6 +1513,7 @@ rs6000_fix_indexing (function *fun)
}
}
}
+#endif
free_dominance_info (CDI_DOMINATORS);
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index dacf27e087c..652cf1fe5ae 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -2553,6 +2553,12 @@ replace_equiv_address (rtx memref, rtx addr, bool inplace)
/* change_address_1 copies the memory attribute structure without change
and that's exactly what we want here. */
update_temp_slot_address (XEXP (memref, 0), addr);
+
+ if (dump_file) {
+ fprintf (dump_file, "kelvin says replace_equiv_address is looking at\n");
+ print_rtl (dump_file, addr);
+ }
+
return change_address_1 (memref, VOIDmode, addr, 1, inplace);
}
diff --git a/gcc/explow.c b/gcc/explow.c
index 52765b4489a..17a9b0c050e 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -614,7 +614,7 @@ memory_address_addr_space (machine_mode mode, rtx x, addr_space_t as)
fprintf (dump_file, " address space is: %d\n", as);
fprintf (dump_file, " my addr is: ");
print_rtl (dump_file, x);
- fprintf (dump_file, "\n why would anyone think this is a PLUS?\n");
+ fprintf (dump_file, "\n");
}
return x;