diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-30 21:18:27 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-30 21:18:27 +0000 |
commit | bef5a5f54eaf24fa1b0c88d61c56dbcfbc726332 (patch) | |
tree | 5a67423ba589151bbc206347ce3c647cfe0eab48 /gcc/tree-chrec.h | |
parent | 7ba04629c3c303458b20f132210f4706d850bf6c (diff) | |
download | gcc-bef5a5f54eaf24fa1b0c88d61c56dbcfbc726332.tar.gz |
A function is affine when CHREC_RIGHT is invariant.
2010-08-20 Sebastian Pop <sebastian.pop@amd.com>
* tree-chrec.h (evolution_function_is_affine_p): Do not check
whether CHREC_LEFT is invariant. A function is affine when
CHREC_RIGHT is invariant.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164788 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-chrec.h')
-rw-r--r-- | gcc/tree-chrec.h | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/gcc/tree-chrec.h b/gcc/tree-chrec.h index eb60ac94601..58b14e7dc5b 100644 --- a/gcc/tree-chrec.h +++ b/gcc/tree-chrec.h @@ -202,23 +202,10 @@ evolution_function_is_affine_in_loop (const_tree chrec, int loopnum) static inline bool evolution_function_is_affine_p (const_tree chrec) { - if (chrec == NULL_TREE) - return false; - - switch (TREE_CODE (chrec)) - { - case POLYNOMIAL_CHREC: - if (evolution_function_is_invariant_p (CHREC_LEFT (chrec), - CHREC_VARIABLE (chrec)) - && evolution_function_is_invariant_p (CHREC_RIGHT (chrec), - CHREC_VARIABLE (chrec))) - return true; - else - return false; - - default: - return false; - } + return chrec + && TREE_CODE (chrec) == POLYNOMIAL_CHREC + && evolution_function_is_invariant_p (CHREC_RIGHT (chrec), + CHREC_VARIABLE (chrec)); } /* Determines whether EXPR does not contains chrec expressions. */ |