[Bug rtl-optimization/45223] RTL PRE GCSE pass hoists trapping insn out of loop

2021-10-11 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45223

--- Comment #9 from Richard Biener  ---
But this but is about non-MEMs while the fixes were involving only memory ops
IIRC.

[Bug rtl-optimization/45223] RTL PRE GCSE pass hoists trapping insn out of loop

2021-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45223

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=101373,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=101868

--- Comment #8 from Andrew Pinski  ---
So I think this has been fully fixed for GCC 12 via r12-2254 (aka PR 101373).

[Bug rtl-optimization/45223] RTL PRE GCSE pass hoists trapping insn out of loop

2016-02-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45223
Bug 45223 depends on bug 42108, which changed state.

Bug 42108 Summary: [4.9 Regression] 50% performance regression
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42108

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug rtl-optimization/45223] RTL PRE GCSE pass hoists trapping insn out of loop

2010-09-04 Thread ubizjak at gmail dot com


--- Comment #7 from ubizjak at gmail dot com  2010-09-04 10:03 ---
Unassigning...


-- 

ubizjak at gmail dot com changed:

   What|Removed |Added

 AssignedTo|ubizjak at gmail dot com|unassigned at gcc dot gnu
   ||dot org
 Status|ASSIGNED|NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45223



[Bug rtl-optimization/45223] RTL PRE GCSE pass hoists trapping insn out of loop

2010-08-12 Thread ubizjak at gmail dot com


--- Comment #6 from ubizjak at gmail dot com  2010-08-12 14:46 ---
Ouch, Here are the ration of before and after on Intel Core i7. Gzip slowed
down by 10 to 20%. [1]

Richi says: The fix is to teach LIM to do conditional invariant motion.

Probably also related to PR42108 catch-all PR.

[1] http://gcc.gnu.org/ml/gcc-patches/2010-08/msg00771.html
[2] http://gcc.gnu.org/ml/gcc-patches/2010-08/msg00884.html


-- 

ubizjak at gmail dot com changed:

   What|Removed |Added

  BugsThisDependsOn||42108


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45223



[Bug rtl-optimization/45223] RTL PRE GCSE pass hoists trapping insn out of loop

2010-08-07 Thread ubizjak at gmail dot com


--- Comment #1 from ubizjak at gmail dot com  2010-08-07 08:33 ---
Following patch fixes this problem:

Index: gcse.c
===
--- gcse.c  (revision 162975)
+++ gcse.c  (working copy)
@@ -1693,7 +1693,7 @@ compute_hash_table_work (struct hash_tab

   /* The next pass builds the hash table.  */
   FOR_BB_INSNS (current_bb, insn)
-   if (INSN_P (insn))
+   if (INSN_P (insn)  !may_trap_p (PATTERN (insn)))
  hash_scan_insn (insn, table);
 }


main:
push   $sp, $r6
push   $sp, $r7
push   $sp, $r8
push   $sp, $r9
push   $sp, $r10
push   $sp, $r11
dec$sp, 28
lda.l  $r0, a
sto.l  -28($fp), $r0
lda.l  $r11, b
xor$r6, $r6
ldi.l  $r10, foo
ldi.l  $r8, 8
ldi.l  $r7, 99
jmpa   .L4
.L3:
lda.l  $r1, r
ldo.l  $r0, -28($fp)
mod.l  $r0, $r11
add.l  $r0, $r1
add.l  $r0, $r6
sta.l  r, $r0
inc$r6, 1
cmp$r6, $r7
bgt   .L7
.L4:
jsr$r10
lda.l  $r0, x
cmp$r0, $r8
bne   .L3
inc$r6, 1
lda.l  $r1, r
ldo.l  $r0, -28($fp)
   mod.l  $r0, $r11
add.l  $r0, $r1
add.l  $r0, $r6
sta.l  r, $r0
inc$r6, 1
cmp$r6, $r7
ble   .L4
.L7:
jsra   abort

In a general case, I guess that if it can be proved that denominator can't be
zero we can still hoist mod.l out of the loop.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45223



[Bug rtl-optimization/45223] RTL PRE GCSE pass hoists trapping insn out of loop

2010-08-07 Thread ubizjak at gmail dot com


--- Comment #2 from ubizjak at gmail dot com  2010-08-07 08:40 ---
Ugh, with a bit changed testcase:

--cut here--
extern void exit (int);
extern void abort (void);

volatile float a = 1;
volatile float b = 0;
volatile int x = 2;
volatile signed int r = 8;

void __attribute__((noinline))
foo (void)
{
  exit (0);
}

int
main (void)
{
  float si1 = a;
  float si2 = b;
  int i;

  for (i = 0; i  100; ++i) {
  foo ();
  if (x == 8)
i++;
  r += i + (int) (si1 / si2);
  }
  abort ();
}
--cut here--

-O2 on x86_64-pc-linux-gnu:

main:
pushq   %rbx
xorl%ebx, %ebx
subq$16, %rsp
movss   a(%rip), %xmm0
movss   %xmm0, 12(%rsp)
movss   b(%rip), %xmm0
movss   12(%rsp), %xmm1
   divss   %xmm0, %xmm1
movss   %xmm1, 12(%rsp)
.L4:
callfoo
...

I hope that Ariane-5 is safe [1] ;)

[1] http://en.wikipedia.org/wiki/Ariane_5_Flight_501


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45223



[Bug rtl-optimization/45223] RTL PRE GCSE pass hoists trapping insn out of loop

2010-08-07 Thread steven at gcc dot gnu dot org


--- Comment #3 from steven at gcc dot gnu dot org  2010-08-07 10:57 ---
Patch of comment #1 loops obviously OK to me. We shouldn't want to move
trapping insns in any case that I can think of.


-- 

steven at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2010-08-07 10:57:54
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45223



[Bug rtl-optimization/45223] RTL PRE GCSE pass hoists trapping insn out of loop

2010-08-07 Thread ubizjak at gmail dot com


--- Comment #4 from ubizjak at gmail dot com  2010-08-07 11:26 ---
(In reply to comment #3)
 Patch of comment #1 loops obviously OK to me. We shouldn't want to move
 trapping insns in any case that I can think of.

OK, will post patch to gcc-patches after regression test.


-- 

ubizjak at gmail dot com changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |ubizjak at gmail dot com
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2010-08-07 10:57:54 |2010-08-07 11:26:29
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45223



[Bug rtl-optimization/45223] RTL PRE GCSE pass hoists trapping insn out of loop

2010-08-07 Thread ubizjak at gmail dot com


--- Comment #5 from ubizjak at gmail dot com  2010-08-07 15:27 ---
Patch at [1].

[1] http://gcc.gnu.org/ml/gcc-patches/2010-08/msg00553.html


-- 

ubizjak at gmail dot com changed:

   What|Removed |Added

URL||http://gcc.gnu.org/ml/gcc-
   ||patches/2010-
   ||08/msg00553.html


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45223