public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/108786] New: bitmap_first_set_bit misses a bitmap_clear_first_bit
@ 2023-02-14 14:21 rguenth at gcc dot gnu.org
  2023-02-14 14:30 ` [Bug middle-end/108786] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-02-14 14:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108786

            Bug ID: 108786
           Summary: bitmap_first_set_bit misses a bitmap_clear_first_bit
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

We have a repeated pattern for worklists doing

  unsigned idx = bitmap_first_set_bit (b);
  bitmap_clear_bit (b, idx);

but bitmap_clear_bit is more expensive and in particular prone to
clobber ->current which will pessimize other accesses to the same
bitmap.

bitmap_clear_first_bit would return the bit number cleared so it can
be used to pop an item from a worklist efficiently.

If the order doesn't matter a pick-one API also is missing which would
be more efficient for the tree form.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-18 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-14 14:21 [Bug middle-end/108786] New: bitmap_first_set_bit misses a bitmap_clear_first_bit rguenth at gcc dot gnu.org
2023-02-14 14:30 ` [Bug middle-end/108786] " rguenth at gcc dot gnu.org
2023-04-18 14:45 ` cvs-commit at gcc dot gnu.org
2023-04-18 14:57 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).