Commit 65e21467 by Martin Liska Committed by Martin Liska

HSA: handle alignment of string builtins (PR hsa/70391)

	PR hsa/70391
	* hsa-gen.c (hsa_function_representation::update_dominance): New
	function.
	(convert_addr_to_flat_segment): Likewise.
	(gen_hsa_memory_set): New alignment argument.
	(gen_hsa_ctor_assignment): Likewise.
	(gen_hsa_insns_for_single_assignment): Provide alignment
	to gen_hsa_ctor_assignment.
	(gen_hsa_insns_for_direct_call): Add new argument.
	(expand_lhs_of_string_op): New function.
	(expand_string_operation_builtin): Likewise.
	(expand_memory_copy): New function.
	(expand_memory_set): New function.
	(gen_hsa_insns_for_call): Use HOST_WIDE_INT.
	(convert_switch_statements): Change signature.
	(generate_hsa): Use a return value of the function.
	(pass_gen_hsail::execute): Do not call
	convert_switch_statements here.
	* hsa-regalloc.c (hsa_regalloc): Call update_dominance.
	* hsa.h (hsa_function_representation::m_modified_cfg):
	New flag.
	(hsa_function_representation::update_dominance): New function.

From-SVN: r234644
parent 320c1a36
2016-03-31 Martin Liska <mliska@suse.cz> 2016-03-31 Martin Liska <mliska@suse.cz>
PR hsa/70391 PR hsa/70391
* hsa-gen.c (hsa_function_representation::update_dominance): New
function.
(convert_addr_to_flat_segment): Likewise.
(gen_hsa_memory_set): New alignment argument.
(gen_hsa_ctor_assignment): Likewise.
(gen_hsa_insns_for_single_assignment): Provide alignment
to gen_hsa_ctor_assignment.
(gen_hsa_insns_for_direct_call): Add new argument.
(expand_lhs_of_string_op): New function.
(expand_string_operation_builtin): Likewise.
(expand_memory_copy): New function.
(expand_memory_set): New function.
(gen_hsa_insns_for_call): Use HOST_WIDE_INT.
(convert_switch_statements): Change signature.
(generate_hsa): Use a return value of the function.
(pass_gen_hsail::execute): Do not call
convert_switch_statements here.
* hsa-regalloc.c (hsa_regalloc): Call update_dominance.
* hsa.h (hsa_function_representation::m_modified_cfg):
New flag.
(hsa_function_representation::update_dominance): New function.
2016-03-31 Martin Liska <mliska@suse.cz>
PR hsa/70391
* hsa-brig.c (emit_directive_variable): Emit alignment * hsa-brig.c (emit_directive_variable): Emit alignment
according to hsa_symbol::m_align. according to hsa_symbol::m_align.
* hsa-dump.c (hsa_byte_alignment): Move the function to * hsa-dump.c (hsa_byte_alignment): Move the function to
......
...@@ -700,6 +700,7 @@ regalloc (void) ...@@ -700,6 +700,7 @@ regalloc (void)
void void
hsa_regalloc (void) hsa_regalloc (void)
{ {
hsa_cfun->update_dominance ();
naive_outof_ssa (); naive_outof_ssa ();
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
......
...@@ -1123,7 +1123,8 @@ class hsa_function_representation ...@@ -1123,7 +1123,8 @@ class hsa_function_representation
{ {
public: public:
hsa_function_representation (tree fdecl, bool kernel_p, hsa_function_representation (tree fdecl, bool kernel_p,
unsigned ssa_names_count); unsigned ssa_names_count,
bool modified_cfg = false);
hsa_function_representation (hsa_internal_fn *fn); hsa_function_representation (hsa_internal_fn *fn);
~hsa_function_representation (); ~hsa_function_representation ();
...@@ -1139,6 +1140,9 @@ public: ...@@ -1139,6 +1140,9 @@ public:
so we need hsa_bb instances of them. */ so we need hsa_bb instances of them. */
void init_extra_bbs (); void init_extra_bbs ();
/* Update CFG dominators if m_modified_cfg flag is set. */
void update_dominance ();
/* Return linkage of the representation. */ /* Return linkage of the representation. */
BrigLinkage8_t get_linkage (); BrigLinkage8_t get_linkage ();
...@@ -1219,6 +1223,9 @@ public: ...@@ -1219,6 +1223,9 @@ public:
/* SSA names mapping. */ /* SSA names mapping. */
vec <hsa_op_reg_p> m_ssa_map; vec <hsa_op_reg_p> m_ssa_map;
/* Flag whether a function needs update of dominators before RA. */
bool m_modified_cfg;
}; };
enum hsa_function_kind enum hsa_function_kind
......
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