Commit 848a392a by Martin Jambor Committed by Martin Jambor

[PR 70646] Store size to inlining predicate conditions

2016-05-18  Martin Jambor  <mjambor@suse.cz>

	PR ipa/70646
	* ipa-inline.h (condition): New field size.
	* ipa-inline-analysis.c (add_condition): New parameter SIZE, use it
	for comaprison and store it into the new condition.
	(evaluate_conditions_for_known_args): Use condition size to check
	access sizes for all but CHANGED conditions.
	(unmodified_parm_1): New parameter size_p, store access size into it.
	(unmodified_parm): Likewise.
	(unmodified_parm_or_parm_agg_item): Likewise.
	(eliminated_by_inlining_prob): Pass NULL to unmodified_parm as size_p.
	(set_cond_stmt_execution_predicate): Extract access sizes and store
	them to conditions.
	(set_switch_stmt_execution_predicate): Likewise.
	(will_be_nonconstant_expr_predicate): Likewise.
	(will_be_nonconstant_predicate): Likewise.
	(inline_read_section): Stream condition size.
	(inline_write_summary): Likewise.

testsuite/
	* gcc.dg/ipa/pr70646.c: New test.

From-SVN: r236389
parent 1f2ab776
2016-05-18 Martin Jambor <mjambor@suse.cz>
PR ipa/70646
* ipa-inline.h (condition): New field size.
* ipa-inline-analysis.c (add_condition): New parameter SIZE, use it
for comaprison and store it into the new condition.
(evaluate_conditions_for_known_args): Use condition size to check
access sizes for all but CHANGED conditions.
(unmodified_parm_1): New parameter size_p, store access size into it.
(unmodified_parm): Likewise.
(unmodified_parm_or_parm_agg_item): Likewise.
(eliminated_by_inlining_prob): Pass NULL to unmodified_parm as size_p.
(set_cond_stmt_execution_predicate): Extract access sizes and store
them to conditions.
(set_switch_stmt_execution_predicate): Likewise.
(will_be_nonconstant_expr_predicate): Likewise.
(will_be_nonconstant_predicate): Likewise.
(inline_read_section): Stream condition size.
(inline_write_summary): Likewise.
2016-05-18 Richard Biener <rguenther@suse.de> 2016-05-18 Richard Biener <rguenther@suse.de>
* tree-ssa-loop-im.c (determine_max_movement): Properly add * tree-ssa-loop-im.c (determine_max_movement): Properly add
......
...@@ -34,6 +34,8 @@ struct GTY(()) condition ...@@ -34,6 +34,8 @@ struct GTY(()) condition
/* If agg_contents is set, this is the offset from which the used data was /* If agg_contents is set, this is the offset from which the used data was
loaded. */ loaded. */
HOST_WIDE_INT offset; HOST_WIDE_INT offset;
/* Size of the access reading the data (or the PARM_DECL SSA_NAME). */
HOST_WIDE_INT size;
tree val; tree val;
int operand_num; int operand_num;
ENUM_BITFIELD(tree_code) code : 16; ENUM_BITFIELD(tree_code) code : 16;
......
2016-05-18 Martin Jambor <mjambor@suse.cz>
PR ipa/70646
* gcc.dg/ipa/pr70646.c: New test.
2016-05-18 Christophe Lyon <christophe.lyon@linaro.org> 2016-05-18 Christophe Lyon <christophe.lyon@linaro.org>
* gcc.target/aarch64/advsimd-intrinsics/vget_lane.c: Add fp16 tests. * gcc.target/aarch64/advsimd-intrinsics/vget_lane.c: Add fp16 tests.
......
/* { dg-do run } */
/* { dg-options "-O2" } */
#pragma GCC optimize("no-unit-at-a-time")
typedef unsigned char u8;
typedef unsigned long long u64;
static inline __attribute__((always_inline)) u64 __swab64p(const u64 *p)
{
return (__builtin_constant_p((u64)(*p)) ? ((u64)( (((u64)(*p) & (u64)0x00000000000000ffULL) << 56) | (((u64)(*p) & (u64)0x000000000000ff00ULL) << 40) | (((u64)(*p) & (u64)0x0000000000ff0000ULL) << 24) | (((u64)(*p) & (u64)0x00000000ff000000ULL) << 8) | (((u64)(*p) & (u64)0x000000ff00000000ULL) >> 8) | (((u64)(*p) & (u64)0x0000ff0000000000ULL) >> 24) | (((u64)(*p) & (u64)0x00ff000000000000ULL) >> 40) | (((u64)(*p) & (u64)0xff00000000000000ULL) >> 56))) : __builtin_bswap64(*p));
}
static inline u64 wwn_to_u64(void *wwn)
{
return __swab64p(wwn);
}
void __attribute__((noinline,noclone)) broken(u64* shost)
{
u8 node_name[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
*shost = wwn_to_u64(node_name);
}
void __attribute__((noinline,noclone)) dummy(void)
{
__builtin_abort();
}
int main(int argc, char* argv[])
{
u64 v;
broken(&v);
if(v != (u64)-1)
__builtin_abort();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment