diff options
author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-21 06:48:37 +0000 |
---|---|---|
committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-21 06:48:37 +0000 |
commit | 7413a5e0de59252e5a4f67675348fe8c5e080206 (patch) | |
tree | 453b4b811e202e10cc059d2b5983b89bee93f6fc /gcc/gcse.c | |
parent | e865d428feeded19929478380bd55a42d18b30a9 (diff) | |
download | gcc-7413a5e0de59252e5a4f67675348fe8c5e080206.tar.gz |
gcc/ChangeLog:
* gcse.c (store_killed_in_insn): Handle PARALLELs.
(store_killed_in_pat): New.
gcc/testsuite/ChangeLog:
* gcc.target/i386/movsi-sm-1.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124015 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r-- | gcc/gcse.c | 69 |
1 files changed, 45 insertions, 24 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c index 36b2c8f9db4..70c89ef95fc 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -5909,6 +5909,39 @@ find_loads (rtx x, rtx store_pattern, int after) return ret; } +static inline bool +store_killed_in_pat (rtx x, rtx pat, int after) +{ + if (GET_CODE (pat) == SET) + { + rtx dest = SET_DEST (pat); + + if (GET_CODE (dest) == ZERO_EXTRACT) + dest = XEXP (dest, 0); + + /* Check for memory stores to aliased objects. */ + if (MEM_P (dest) + && !expr_equiv_p (dest, x)) + { + if (after) + { + if (output_dependence (dest, x)) + return true; + } + else + { + if (output_dependence (x, dest)) + return true; + } + } + } + + if (find_loads (pat, x, after)) + return true; + + return false; +} + /* Check if INSN kills the store pattern X (is aliased with it). AFTER is true if we are checking the case when store X occurs after the insn. Return true if it does. */ @@ -5916,7 +5949,7 @@ find_loads (rtx x, rtx store_pattern, int after) static bool store_killed_in_insn (rtx x, rtx x_regs, rtx insn, int after) { - rtx reg, base, note; + rtx reg, base, note, pat; if (!INSN_P (insn)) return false; @@ -5943,32 +5976,20 @@ store_killed_in_insn (rtx x, rtx x_regs, rtx insn, int after) return false; } - if (GET_CODE (PATTERN (insn)) == SET) + pat = PATTERN (insn); + if (GET_CODE (pat) == SET) { - rtx pat = PATTERN (insn); - rtx dest = SET_DEST (pat); - - if (GET_CODE (dest) == ZERO_EXTRACT) - dest = XEXP (dest, 0); - - /* Check for memory stores to aliased objects. */ - if (MEM_P (dest) - && !expr_equiv_p (dest, x)) - { - if (after) - { - if (output_dependence (dest, x)) - return true; - } - else - { - if (output_dependence (x, dest)) - return true; - } - } - if (find_loads (SET_SRC (pat), x, after)) + if (store_killed_in_pat (x, pat, after)) return true; } + else if (GET_CODE (pat) == PARALLEL) + { + int i; + + for (i = 0; i < XVECLEN (pat, 0); i++) + if (store_killed_in_pat (x, XVECEXP (pat, 0, i), after)) + return true; + } else if (find_loads (PATTERN (insn), x, after)) return true; |