search for: devirtu

Displaying 20 results from an estimated 259 matches for "devirtu".

Did you mean: devirt
2019 Dec 11
5
RFC: Safe Whole Program Devirtualization Enablement
Please send any comments. As mentioned at the end I will follow up with some patches as soon as they are cleaned up and I create some test cases. RFC: Safe Whole Program Devirtualization Enablement =================================================== High Level Summary ------------------ The goal of the changes described in this RFC is to support aggressive Whole Program Devirtualization without requiring -fvisibility=hidden at compile time, by pre-enabling bitcode for wh...
2010 Oct 13
4
[LLVMdev] Missed devirtualization opportunities
...>>> can't >>> know that they won't modify the vptr in advance, so invariant doesn't >>> work >>> here. Making it non-local just means that we would need to know the >>> static >>> call graph, which we don't because we haven't devirtualized yet so all >>> the >>> calls are indirect. >>> Nick >> >> So that means you're now saying that llvm.invariant.end ought to be >> left the way it is, right? > > I have no idea how to make use of llvm.invariant to help devirtualization. &gt...
2011 Dec 09
0
[LLVMdev] Implementing devirtualization
Vitor Luis Menezes wrote: > Hello all, > > Our compilers class has been using LLVM, and a partner and I decided to > implement devirtualization of virtual C++ calls in LLVM as a class > project. We quickly realized that existing debug metadata generated by > Clang didn't give us enough info to (precisely) implement this, and as > such have already begun modifying Clang to insert such metadata. > However, for devirt...
2017 Dec 07
2
devirtualization with new-PM pipeline
Chandler et al, I have been playing with the new PM pipeline, being particularly interested in how it can handle devirtualization. Now, I discovered what I believe is a "regression" vs old PM on a rather simple one-translation-unit testcase. clang is able to devirtualize it with -O3 and fails to do so with -fexperimental-new-pass-manager added. It looks like a pipeline issue, though I did not dig deeper...
2010 Oct 14
0
[LLVMdev] Missed devirtualization opportunities
...;t >>>> know that they won't modify the vptr in advance, so invariant doesn't >>>> work >>>> here. Making it non-local just means that we would need to know the >>>> static >>>> call graph, which we don't because we haven't devirtualized yet so all >>>> the >>>> calls are indirect. >>>> Nick >>> >>> So that means you're now saying that llvm.invariant.end ought to be >>> left the way it is, right? >> >> I have no idea how to make use of llvm.invaria...
2017 Dec 14
2
devirtualization with new-PM pipeline
...ew PM. The DevirtSCCRepeatedPass::run method first scans the functions in the SCC to collect value handles for indirect calls, runs the CGSCC pass pipeline and then checks if any of the call value handles now point to a direct call, in which case it runs the pipeline again (which should inline the devirtualized call) . The problem is scanning the initial SCC for indirect calls is not enough since inlining can produce indirect calls (which could then get devirtualized by later passes). One (ugly) fix is to pass the value handles to the inliner through CGSCCUpdateResult and let the inliner augment it...
2017 Nov 30
3
Question about visibility analysis for whole program devirtualization pass
Hi! I have a question about whole program devirtualization pass. According to my understanding devirtualization is performed only for the classes that have hidden LTO visibility and this visibility is controlled by attributes in the source level or command line options. So visibility analysis is currently performed only in the front-end. But LLV...
2010 Oct 13
0
[LLVMdev] Missed devirtualization opportunities
...;t >>>> know that they won't modify the vptr in advance, so invariant doesn't >>>> work >>>> here. Making it non-local just means that we would need to know the >>>> static >>>> call graph, which we don't because we haven't devirtualized yet so all >>>> the >>>> calls are indirect. >>>> Nick >>> >>> So that means you're now saying that llvm.invariant.end ought to be >>> left the way it is, right? >> >> I have no idea how to make use of llvm.invar...
2011 Dec 08
4
[LLVMdev] Implementing devirtualization
Hello all, Our compilers class has been using LLVM, and a partner and I decided to implement devirtualization of virtual C++ calls in LLVM as a class project. We quickly realized that existing debug metadata generated by Clang didn't give us enough info to (precisely) implement this, and as such have already begun modifying Clang to insert such metadata. However, for devirtualization we also n...
2010 Oct 13
0
[LLVMdev] Missed devirtualization opportunities
...functions actually get called, even indirectly. We can't >> know that they won't modify the vptr in advance, so invariant doesn't work >> here. Making it non-local just means that we would need to know the static >> call graph, which we don't because we haven't devirtualized yet so all the >> calls are indirect. >> Nick > > So that means you're now saying that llvm.invariant.end ought to be > left the way it is, right? I have no idea how to make use of llvm.invariant to help devirtualization. If no use or other use case for them can be...
2010 Oct 14
2
[LLVMdev] Missed devirtualization opportunities
...gt; know that they won't modify the vptr in advance, so invariant doesn't >>>>> work >>>>> here. Making it non-local just means that we would need to know the >>>>> static >>>>> call graph, which we don't because we haven't devirtualized yet so all >>>>> the >>>>> calls are indirect. >>>>> Nick >>>> >>>> So that means you're now saying that llvm.invariant.end ought to be >>>> left the way it is, right? >>> >>> I have no idea...
2010 Oct 11
0
[LLVMdev] Missed devirtualization opportunities
On Oct 11, 2010, at 9:12 AM, Kenneth Uildriks wrote: > 3. The front-end, recognizing that scribbling on an instance's vtbl > pointer has undefined results, eliminated the loads of the vtbl > pointer and replaced them with @classvtbl.TestVirtual. This would > allow devirtualization within a function at least, but (I think) would > do less to allow analysis to spot devirtualization opportunities > across functions. (Although ArgPromotion could arrange to have the > vtbl pointer passed in separately, and then inlining and/or partial > specialization could...
2015 Feb 04
2
[LLVMdev] IR extension proposal: bitset constants
On Tue, Feb 03, 2015 at 04:03:45PM -0800, Sean Silva wrote: > One other thing: if this can be used for control-flow integrity, I assume > it has to have good knowledge of the available indirect call targets. Could > we also use this information for devirtualization? I would expect so. If a bitset contains only one element, we should be able to teach the lowering pass to simply test that the given pointer is equal to that element (i.e. the only valid vptr). If the later IR branches to a trapping block if that condition is false, it should be possible...
2017 Dec 06
2
Question about visibility analysis for whole program devirtualization pass
...he class is final, doesn’t it? Thanks, Nikolai From: Peter Collingbourne [mailto:peter at pcc.me.uk] Sent: Wednesday, December 6, 2017 4:36 AM To: Gainullin, Artur <artur.gainullin at intel.com> Cc: llvm-dev at lists.llvm.org Subject: Re: Question about visibility analysis for whole program devirtualization pass Hi Artur, Unfortunately, making a visibility analysis at that level would not always give correct results because the symbol information provided by the linker is insufficient to make determinations about which type hierarchies are closed at LTO time. For example, consider a main pr...
2018 Mar 20
0
[cfe-dev] RFC: Devirtualization v2
...the transform that was problematic. Presumably, clang would only strip invariant groups from pointers to dynamic types before casting them or using them in a comparison, so that the value equivalence optimization still works in the general case. The proposal trades value equivalence power for more devirtualization power. One downside is that it may add many new IR instructions, but I don't see how to avoid them, as the whole point is to create distinct Value objects for use in the pointer equality comparison. On Mon, Mar 19, 2018 at 4:31 PM Piotr Padlewski via cfe-dev < cfe-dev at lists.llv...
2015 Jan 07
2
[LLVMdev] Inclusion of iostream affects devirtualization in release_35
Hello, I've stumbled upon the following behavior in branches/release_35 (as of 218689) under ubuntu 14.04 LTS amd64: whenever I include the (system-wise) gnu iostream header, clang++ stops devirtualizing the following code: #if BREAKAGE_ENSUES #include <iostream> #endif struct Base { virtual int foo() const = 0; }; struct A : Base { int a; A(const int a) : a(a) { } int foo() const { return a; } }; struct B : Base { const Base* b; B(const Base* const base) : b(base) { } int foo...
2010 Oct 13
3
[LLVMdev] Missed devirtualization opportunities
...ess of what functions actually get called, even indirectly. We can't > know that they won't modify the vptr in advance, so invariant doesn't work > here. Making it non-local just means that we would need to know the static > call graph, which we don't because we haven't devirtualized yet so all the > calls are indirect. > Nick So that means you're now saying that llvm.invariant.end ought to be left the way it is, right? I've been thinking about how to better take the invariant regions into account, and it quickly became clear that it would be easier to han...
2016 Jun 20
2
Intended behavior of CGSCC pass manager.
...nd then calls a virtual > function on the instance, then the virtual function being called and > the constructor will have been maximally simplified (F refs the > constructor, and the constructor refs all the virtual functions), and > you're more likely to inline the constructor and devirtualize the > call. I don't have any real data to back up that this will materially > help, though. Sanjoy, this is a good example. The code pattern is basically like this: Worker(Base *B) { B->vCall(); } Factory::create(Kind K) { if (K == ..) return new D1(); else ... }...
2010 Oct 11
4
[LLVMdev] Missed devirtualization opportunities
...ntptr %class.TestVirtual* %pinstance, i64 0, i32 0 ; Populate the instance's vtbl pointer. After this, the instance is constructed. store %classvtbltype.TestVirtual* @classvtbl.TestVirtual, %classvtbltype.TestVirtual** %ppVtbl ; If this next call is commented out, the virtual method call is devirtualized by -std-compile-opts %puts = call i32 @puts(i8* getelementptr inbounds ([2 x i8]* @str, i32 0, i32 0)) ; Call the virtual function. ; load the instance's vtbl pointer. %pVtbl1 = load %classvtbltype.TestVirtual** %ppVtbl ; load the function pointer from the vtbl %ppVfn1 = getelementptr...
2010 Oct 14
0
[LLVMdev] Missed devirtualization opportunities
...ey won't modify the vptr in advance, so invariant doesn't >>>>>> work >>>>>> here. Making it non-local just means that we would need to know the >>>>>> static >>>>>> call graph, which we don't because we haven't devirtualized yet so all >>>>>> the >>>>>> calls are indirect. >>>>>> Nick >>>>> >>>>> So that means you're now saying that llvm.invariant.end ought to be >>>>> left the way it is, right? >>>&gt...