[llvm-commits] [llvm] r141177 - in /llvm/trunk: lib/Transforms/Scalar/GVN.cpp test/Transforms/GVN/condprop.ll test/Transforms/GVN/phi-translate.ll

David Blaikie dblaikie at gmail.com
Tue Oct 11 00:51:07 PDT 2011


> > http://llvm.org/viewvc/llvm-project?rev=141177&view=rev
>> Interesting. Might this help the proposed workaround/fix for
>> http://llvm.org/bugs/show_bug.**cgi?id=3100<http://llvm.org/bugs/show_bug.cgi?id=3100>work?
>>
>
> Probably.  Because the testcase is incomplete I was unable to check
> for real.
>

I finally got around to investigating this sufficiently.

It's really close, but not quite. Given the attached llvm assembly, the
function call is correctly devirtualized (but the branch is left in). But if
you comment out the first ret void (in the vtable.ne block) & comment in the
unreachable instruction then the branch is removed by the simplifycfg pass &
no interesting information about the condition is preserved for use by the
GVN pass so the call is still indirect/virtual.

I'm not sufficiently familiar with the passes, their roles, temporal
relations, etc to know exactly where the fix ought to be in this case:
Is the simplifycfg pass throwing away valuable information too early &
should be less aggressive?
Or perhaps the simplifycfg pass should be storing away some details for
later use by the GVN pass?
Other options?

Thanks,
- David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111011/bea61247/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hard.ll
Type: application/octet-stream
Size: 1574 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111011/bea61247/attachment.obj>


More information about the llvm-commits mailing list