diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2010-12-16 22:54:17 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2010-12-16 22:54:17 +0000 |
commit | a30e53454663b6b8fab469d249341c514a6395f6 (patch) | |
tree | a641dbfe3a54dffdf98a22c0dcc0ee96689e0352 /gcc/sese.h | |
parent | 114dae43305796626be7257e51fd53c7e5085f44 (diff) | |
download | gcc-a30e53454663b6b8fab469d249341c514a6395f6.zip gcc-a30e53454663b6b8fab469d249341c514a6395f6.tar.gz gcc-a30e53454663b6b8fab469d249341c514a6395f6.tar.bz2 |
Fix PR46924: Do not detect reductions outside the current SESE region.
2010-12-16 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/46924
* graphite-sese-to-poly.c (detect_commutative_reduction): Do not
detect reductions outside the current SESE region.
* sese.h (stmt_in_sese_p): New.
(defined_in_sese_p): Call stmt_in_sese_p.
* gcc.dg/graphite/pr46924.c: New.
From-SVN: r167962
Diffstat (limited to 'gcc/sese.h')
-rw-r--r-- | gcc/sese.h | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -114,15 +114,22 @@ bb_in_sese_p (basic_block bb, sese region) return bb_in_region (bb, entry, exit); } +/* Returns true when STMT is defined in REGION. */ + +static inline bool +stmt_in_sese_p (gimple stmt, sese region) +{ + basic_block bb = gimple_bb (stmt); + return bb && bb_in_sese_p (bb, region); +} + /* Returns true when NAME is defined in REGION. */ static inline bool defined_in_sese_p (tree name, sese region) { gimple stmt = SSA_NAME_DEF_STMT (name); - basic_block bb = gimple_bb (stmt); - - return bb && bb_in_sese_p (bb, region); + return stmt_in_sese_p (stmt, region); } /* Returns true when LOOP is in REGION. */ |