[llvm-bugs] [Bug 43964] BranchFolder not debug invariant

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 21 09:50:36 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=43964

Jeremy Morse <jeremy.morse.llvm at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aprantl at apple.com,
                   |                            |vsk at apple.com

bjorn.a.pettersson at ericsson.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Fixed By Commit(s)|                            |rG898de302919b
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Jeremy Morse <jeremy.morse.llvm at gmail.com> ---
Hi,

Bjorn wrote:
> It seems like BlockFolder (BlockFolding.cpp) isn't caring that much about 
> CFI instruction inside the tail, but it does make sure it isn't chopping of 
> CFI instructions in the beginning of the block.

I get the impression that this might be an artefact of its "advance then
rewind" approach, rather than something deliberate. One of the comments in the
large block you delete in D70091 illustrates a CFI_INSTRUCTION inside a tail
that shouldn't be "chopped off".

Then again, I know pretty much nothing about CFI anyway.

Paul wrote:
> CFI (call frame information) is emitted whenever unwinding is a possibility.
> That can be with -g, it can also be with -fexceptions (and other similar
> codegen options).

This sounds unpleasant -- if I understand correctly, then if only '-g' was
specified then we want to prioritise not changing codegen; but if -fexceptions
was specified then codegen _should_ change to make exceptions operate
correctly? That could then (potentially) mean two different ways of treating
CFI_INSTRUCTION.

--- Comment #5 from bjorn.a.pettersson at ericsson.com ---
The -g invariance introduced by https://reviews.llvm.org/D66467 has now been
fixed in rG898de302919b (https://reviews.llvm.org/D70091).

The fix restores the old behavior to say that a found common tail cover the
whole basic block even if debug instructions are found before the tail.

As the earlier comments talk a lot about CFI directives I want to highlight
that the fix does not change anything related to CFI directives. If such
instructions are found before the common tail, then we still need to split the
BB when doing a tail merge.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191121/aeab11a9/attachment.html>


More information about the llvm-bugs mailing list