[C++11][4.9] Add missing REDUC_PLUS_EXPR case to potential_constant_expression_1.
James Greenhalgh
james.greenhalgh@arm.com
Fri Apr 19 21:17:00 GMT 2013
Hi Richard,
Thanks for your feedback. This does feel like a much nicer solution now.
> Yes, it looks basically ok. I'd probably restrict it to folding target
> builtins
> though - similar to what TARGET_FOLD_BUILTIN did. Exactly to not
> expose all stmts to the backends. That is, move the target hook call
> to gimple_fold_call, after the inplace check (and remove the inplace
> argument of the target hook), and call it only for DECL_BUILT_IN_CLASS
> BUILT_IN_MD.
This seems sensible - hopefully something like the attached will be
closer to an acceptable implementation. The aarch64 portion certainly
looks much cleaner now.
> Not sure if TARGET_FOLD_STMT is then still an appropriate name ...
> TARGET_FOLD_BUILTIN is already taken unfortunately. Maybe
> TARGET_FOLD_BUILTIN_MD_CALL?
I've gone for TARGET_GIMPLE_FOLD_BUILTIN (to fit with the
non-target-specific gimple_fold_builtin).
I've also updated the documentation for TARGET_FOLD_BUILTIN to
make it clear that the tree returned must be valid in GENERIC
and GIMPLE.
Thanks again for your help.
James
Graduate Engineer
ARM.
---
gcc/
2013-04-19 James Greenhalgh <james.greenhalgh@arm.com>
* coretypes.h (gimple_stmt_iterator_d): Forward declare.
(gimple_stmt_iterator): New typedef.
* gimple.h (gimple_stmt_iterator): Rename to...
(gimple_stmt_iterator_d): ... This.
* doc/tm.texi.in (TARGET_FOLD_BUILTIN): Detail restriction that
trees be valid for GIMPLE and GENERIC.
(TARGET_GIMPLE_FOLD_BUILTIN): New.
* gimple-fold.c (gimple_fold_call): Call target hook
gimple_fold_builtin.
* hooks.c (hook_bool_gsiptr_false): New.
* hooks.h (hook_bool_gsiptr_false): New.
* target.def (fold_stmt): New.
* doc/tm.texi: Regenerate.
2013-04-19 James Greenhalgh <james.greenhalgh@arm.com>
* config/aarch64/aarch64-builtins.c
(aarch64_fold_builtin): Move folds to gimple-specific tree codes
to aarch64_gimple_fold_builtin.
(aarch64_gimple_fold_builtin): New.
* config/aarch64/aarch64-protos.h (aarch64_gimple_fold_builtin): New.
* config/aarch64/aarch64.c (TARGET_GIMPLE_FOLD_BUILTIN): Define.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-RFC-Add-TARGET_GIMPLE_FOLD_BUILTIN-target-hook.patch
Type: text/x-patch
Size: 4756 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130419/75178d52/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-RFC-Impliment-TARGET_GIMPLE_FOLD_BUILTIN-for-aarch64.patch
Type: text/x-patch
Size: 4637 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130419/75178d52/attachment-0001.bin>
More information about the Gcc-patches
mailing list