[PATCH] Branch folding causes different code generation at "-O2 -g" and "-O2"

Chandler Carruth chandlerc at gmail.com
Thu Mar 6 14:51:24 PST 2014


It's not just that. It's actually quite hard to implement because of a few
(sadly, low-priority) deficiencies in LLVM.

Turning on debug info will at the least change a few very small, subtle
things about the resulting IR. Enough to fail a binary diff in many cases,
but no where near enough to actually generate interestingly different code.
Things like register allocation order or the order or the order of two
unrelated instructions will permute in "harmless" ways.

Fixing these instabilities in the IR is an ongoing challenge, and one we're
working on, but its hard to prioritize given than they don't manifest as
anything more severe.

But that of course leaves us out in the cold when we hit bugs like this
where the manifestation is quite severe.


On Thu, Mar 6, 2014 at 2:27 PM, Eric Christopher <echristo at gmail.com> wrote:

> Agreed. It's been on the list for a while but hasn't bubbled to the top.
> On Mar 6, 2014 1:57 PM, "Xinliang David Li" <xinliangli at gmail.com> wrote:
>
>> To proactively find problems like this -- consider doing this in 3-stage
>> compiler bootstrap -- the stage-2 and stage-3 compilations have -g settings
>> toggled -- .text from these two stages should be bit-identical.
>>
>> David
>>
>>
>> On Thu, Mar 6, 2014 at 12:50 PM, Eric Christopher <echristo at gmail.com>wrote:
>>
>>>
>>>   I wouldn't worry about it, just that code generation is often wildly
>>> different on atom and so tests can fail pretty quickly on the atom bots. It
>>> was mostly a heads up to watch the bots after committing something that
>>> looks at particular code generation choices.
>>>
>>> http://llvm-reviews.chandlerc.com/D2970
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140306/44cc57f5/attachment.html>


More information about the llvm-commits mailing list