diff mbox

[committed,nvptx] Add nvptx_override_options_after_change

Message ID 65b84334-0d77-2507-fb65-f94c87ce8d1c@mentor.com
State New
Headers show

Commit Message

Tom de Vries July 21, 2017, 9:49 a.m. UTC
Hi,

this patch adds nvptx_override_options_after_change, containing a 
workaround for PR81430.

Tested on x86_64 with nvptx accelerator.

Committed.

Thanks,
- Tom

Comments

Thomas Schwinge Aug. 8, 2017, 8:45 a.m. UTC | #1
Hi Tom!

On Fri, 21 Jul 2017 11:49:11 +0200, Tom de Vries <Tom_deVries@mentor.com> wrote:
> this patch adds nvptx_override_options_after_change, containing a 
> workaround for PR81430.

> --- a/gcc/config/nvptx/nvptx.c
> +++ b/gcc/config/nvptx/nvptx.c
> @@ -207,6 +207,17 @@ nvptx_option_override (void)
>      target_flags |= MASK_SOFT_STACK | MASK_UNIFORM_SIMT;
>  }
>  
> +/* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE.  */
> +
> +static void
> +nvptx_override_options_after_change (void)
> +{
> +  /* This is a workaround for PR81430 - nvptx acceleration compilation broken
> +     because of running pass_partition_blocks.  This should be dealt with in the
> +     common code, not in the target.  */
> +  flag_reorder_blocks_and_partition = 0;
> +}

Should this be reverted now that r250852 "Apply finish_options on
DECL_FUNCTION_SPECIFIC_OPTIMIZATION for ACCEL_COMPILER" has been
committed?  (I'm confirming this works fine, thanks.)


Grüße
 Thomas
Tom de Vries Aug. 8, 2017, 8:58 a.m. UTC | #2
On 08/08/2017 10:45 AM, Thomas Schwinge wrote:
> Hi Tom!
> 
> On Fri, 21 Jul 2017 11:49:11 +0200, Tom de Vries <Tom_deVries@mentor.com> wrote:
>> this patch adds nvptx_override_options_after_change, containing a
>> workaround for PR81430.
> 
>> --- a/gcc/config/nvptx/nvptx.c
>> +++ b/gcc/config/nvptx/nvptx.c
>> @@ -207,6 +207,17 @@ nvptx_option_override (void)
>>       target_flags |= MASK_SOFT_STACK | MASK_UNIFORM_SIMT;
>>   }
>>   
>> +/* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE.  */
>> +
>> +static void
>> +nvptx_override_options_after_change (void)
>> +{
>> +  /* This is a workaround for PR81430 - nvptx acceleration compilation broken
>> +     because of running pass_partition_blocks.  This should be dealt with in the
>> +     common code, not in the target.  */
>> +  flag_reorder_blocks_and_partition = 0;
>> +}
> 
> Should this be reverted now that r250852 "Apply finish_options on
> DECL_FUNCTION_SPECIFIC_OPTIMIZATION for ACCEL_COMPILER" has been
> committed?  (I'm confirming this works fine, thanks.)

Hi,

Indeed, it can be reverted.

Thanks,
- Tom
diff mbox

Patch

Add nvptx_override_options_after_change

2017-07-21  Tom de Vries  <tom@codesourcery.com>

	PR lto/81430
	* config/nvptx/nvptx.c (nvptx_override_options_after_change): New
	function.
	(TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): Define to
	nvptx_override_options_after_change.

---
 gcc/config/nvptx/nvptx.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index d0aa054..a718054 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -207,6 +207,17 @@  nvptx_option_override (void)
     target_flags |= MASK_SOFT_STACK | MASK_UNIFORM_SIMT;
 }
 
+/* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE.  */
+
+static void
+nvptx_override_options_after_change (void)
+{
+  /* This is a workaround for PR81430 - nvptx acceleration compilation broken
+     because of running pass_partition_blocks.  This should be dealt with in the
+     common code, not in the target.  */
+  flag_reorder_blocks_and_partition = 0;
+}
+
 /* Return a ptx type for MODE.  If PROMOTE, then use .u32 for QImode to
    deal with ptx ideosyncracies.  */
 
@@ -5505,6 +5516,9 @@  nvptx_data_alignment (const_tree type, unsigned int basic_align)
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE nvptx_option_override
 
+#undef TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE
+#define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE nvptx_override_options_after_change
+
 #undef TARGET_ATTRIBUTE_TABLE
 #define TARGET_ATTRIBUTE_TABLE nvptx_attribute_table