[PATCH] [msan] Run more optimization after MemorySanitizer pass

John McCall rjmccall at apple.com
Tue Jan 29 11:06:00 PST 2013


On Jan 29, 2013, at 10:52 AM, Evgeniy Stepanov <eugeni.stepanov at gmail.com> wrote:
> On Tue, Jan 29, 2013 at 10:19 PM, John McCall <rjmccall at apple.com> wrote:
>> On Jan 29, 2013, at 3:29 AM, Evgeniy Stepanov <eugenis at google.com> wrote:
>>> ================
>>> Comment at: lib/CodeGen/BackendUtil.cpp:190
>>> @@ +189,3 @@
>>> +  // MemorySanitizer.
>>> +  if (Builder.OptLevel > 0) {
>>> +    PM.add(createEarlyCSEPass());
>>> ----------------
>>> Alexey Samsonov wrote:
>>>> I think that some comment mentioning the "difference" made by each optimization would
>>>> be nice.
>>> I don't think explaining the difference made by each pass is possible (and would not be helpful). I can add some aggregate performance numbers tomorrow (need to remeasure).
>> 
>> Are you re-running these passes to regain general optimization opportunities
>> after your pass removes or adjusts the msan instrumentation, or are you
>> re-running them to exploit opportunities *with* the msan instrumentation?
> 
> The latter. They are here to optimize the new code that is generated
> in MemorySanitizerPass.

Okay.  That's definitely worth explaining in the comment.  You don't need
an essay with specific examples or anything;  just briefly discuss the kinds
of things you're hoping to see happen (e.g. "The MemorySanitizer pass
adds checks which should be CSE'd when possible.")

John.



More information about the cfe-commits mailing list