<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:fedor.v.sergeev@gmail.com" title="Fedor Sergeev <fedor.v.sergeev@gmail.com>"> <span class="fn">Fedor Sergeev</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Devirtualization fails for loop, while succeeds for a scalar call of the same method"
href="https://bugs.llvm.org/show_bug.cgi?id=20801">bug 20801</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>fedor.v.sergeev@gmail.com
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>FIXED
</td>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Devirtualization fails for loop, while succeeds for a scalar call of the same method"
href="https://bugs.llvm.org/show_bug.cgi?id=20801#c10">Comment # 10</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Devirtualization fails for loop, while succeeds for a scalar call of the same method"
href="https://bugs.llvm.org/show_bug.cgi?id=20801">bug 20801</a>
from <span class="vcard"><a class="email" href="mailto:fedor.v.sergeev@gmail.com" title="Fedor Sergeev <fedor.v.sergeev@gmail.com>"> <span class="fn">Fedor Sergeev</span></a>
</span></b>
<pre>I can confirm that devirtualization does happen with clang -Ofast
-fstrict-vtable-pointers (and still does not happen with just -Ofast).
] clang++ --version
clang version 5.0.1 (<a href="https://github.com/llvm-mirror/clang">https://github.com/llvm-mirror/clang</a>
d8199c9eaa2e16c7b64b6c18fe88d4339321496e) (<a href="https://github.com/llvm-mirror/llvm">https://github.com/llvm-mirror/llvm</a>
8baf891c0f1426d89835f878ba94cb198d93b155)
Target: x86_64-unknown-linux-gnu
Thread model: posix
] clang++ devirt-loop.cpp -Ofast -fstrict-vtable-pointers -emit-llvm -o - -S |
sed -n "/define.*Vector/,/^}/p"
define i32 @_Z6Vectori(i32) local_unnamed_addr #0 {
%2 = icmp sgt i32 %0, 0
%3 = mul i32 %0, 123
%4 = select i1 %2, i32 %3, i32 0
ret i32 %4
}
] clang++ devirt-loop.cpp -Ofast -emit-llvm -o - -S | sed -n
"/define.*Vector/,/^}/p" | grep call
%2 = tail call i8* @_Znwm(i64 8) #4
%8 = tail call i32 @_ZN1A1fEv(%class.A* nonnull %3)
%18 = tail call i32 %17(%class.A* nonnull %3)
]</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>