mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-14 00:21:05 +08:00
Fix for PR 91333 - suboptimal register allocation for inline asm
2020-01-31 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/91333 * ira-color.c (bucket_allocno_compare_func): Move conflict hard reg preferences comparison up. 2020-01-31 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/91333 * gcc.target/i386/pr91333.c: New.
This commit is contained in:
parent
f1c807e887
commit
2a07345c4f
@ -1,3 +1,9 @@
|
||||
2020-01-31 Vladimir Makarov <vmakarov@redhat.com>
|
||||
|
||||
PR rtl-optimization/91333
|
||||
* ira-color.c (bucket_allocno_compare_func): Move conflict hard
|
||||
reg preferences comparison up.
|
||||
|
||||
2020-01-31 Richard Sandiford <richard.sandiford@arm.com>
|
||||
|
||||
* config/aarch64/aarch64.h (TARGET_SVE_BF16): New macro.
|
||||
|
@ -2251,6 +2251,11 @@ bucket_allocno_compare_func (const void *v1p, const void *v2p)
|
||||
ira_allocno_t t2 = ALLOCNO_COLOR_DATA (a2)->first_thread_allocno;
|
||||
int cl1 = ALLOCNO_CLASS (a1), cl2 = ALLOCNO_CLASS (a2);
|
||||
|
||||
/* Push allocnos with minimal conflict_allocno_hard_prefs first. */
|
||||
pref1 = ALLOCNO_COLOR_DATA (a1)->conflict_allocno_hard_prefs;
|
||||
pref2 = ALLOCNO_COLOR_DATA (a2)->conflict_allocno_hard_prefs;
|
||||
if ((diff = pref1 - pref2) != 0)
|
||||
return diff;
|
||||
freq1 = ALLOCNO_COLOR_DATA (t1)->thread_freq;
|
||||
freq2 = ALLOCNO_COLOR_DATA (t2)->thread_freq;
|
||||
if ((diff = freq1 - freq2) != 0)
|
||||
@ -2276,11 +2281,6 @@ bucket_allocno_compare_func (const void *v1p, const void *v2p)
|
||||
a2_num = ALLOCNO_COLOR_DATA (a2)->available_regs_num;
|
||||
if ((diff = a2_num - a1_num) != 0)
|
||||
return diff;
|
||||
/* Push allocnos with minimal conflict_allocno_hard_prefs first. */
|
||||
pref1 = ALLOCNO_COLOR_DATA (a1)->conflict_allocno_hard_prefs;
|
||||
pref2 = ALLOCNO_COLOR_DATA (a2)->conflict_allocno_hard_prefs;
|
||||
if ((diff = pref1 - pref2) != 0)
|
||||
return diff;
|
||||
return ALLOCNO_NUM (a2) - ALLOCNO_NUM (a1);
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
2020-01-31 Vladimir Makarov <vmakarov@redhat.com>
|
||||
|
||||
PR rtl-optimization/91333
|
||||
* gcc.target/i386/pr91333.c: New.
|
||||
|
||||
2020-01-31 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
PR analyzer/93379
|
||||
|
14
gcc/testsuite/gcc.target/i386/pr91333.c
Normal file
14
gcc/testsuite/gcc.target/i386/pr91333.c
Normal file
@ -0,0 +1,14 @@
|
||||
/* { dg-do compile { target x86_64-*-* } } */
|
||||
/* { dg-options "-O2 -mavx" } */
|
||||
/* { dg-final { scan-assembler-times "vmovapd" 2 } } */
|
||||
|
||||
static inline double g (double x){
|
||||
asm volatile ("" : "+x" (x));
|
||||
return x;
|
||||
}
|
||||
static inline double f (double a, double b){
|
||||
return g (g (a) + g (b));
|
||||
}
|
||||
double h (double a, double b){
|
||||
return f (f (a, a), f (b, b));
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user