[llvm-bugs] [Bug 39176] [SimplifyCFG] Merge DebugLoc when speculatively hoisting store instruction

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 4 15:13:49 PDT 2018


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

David Blaikie <dblaikie at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from David Blaikie <dblaikie at gmail.com> ---
This current behavior looks right to me.

If the speculated store kept line 3, then profiles would give the wrong
behavior (& the debugger could cause someone to conclude invalid things about
the code) - the debugger user (or profiler) could appear to reach line 3 even
though j != 10.

(eg: a sample profiler could record a sample at the time the speculated store
was executing - recording that the program was executing line 3 at the time. A
profile based optimization could then conclude that j is == 10 for that sample
- this could bias optimizations incorrectly.

As a debugger user you could appear to step to line 3 even though j is != 10 -
confusing the user)

The merge looks OK - merging the destination with the speculated code. So if
they happen to all come from the same line of source code, then it's OK-ish.
There's no confusion/invalid implication.

-- 
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/20181004/69b1e180/attachment.html>


More information about the llvm-bugs mailing list