search for: _ztv1b

Displaying 20 results from an estimated 26 matches for "_ztv1b".

2015 Jan 27
7
[LLVMdev] IR extension proposal: bitset constants
...a load of the appropriate bit from the bit set. To give a concrete example, suppose we have the following classes: struct A { virtual void f(); }; struct B : A { virtual void f(), g(); }; struct C : A { virtual void f(), h(); }; with the following vtables: _ZTV1A = { &A::rtti, &A::f }; _ZTV1B = { &B::rtti, &B::f, &B::g }; _ZTV1C = { &C::rtti, &C::f, &C::h }; The set of valid vtables for static class A is {&_ZTV1A[1], &_ZTV1B[1], &_ZTV1C[1]}, for B is {&_ZTV1B[1]} and for C is {&_ZTV1C[1]}. The toolchain would lay out _ZTV1A, _ZTV1B and _ZTV1C...
2012 Mar 19
5
[LLVMdev] recognizing DTORs and vptr updates in LLVM.
...DTOR. Rationale: need to distinguish benign and harmful races on vptr ( http://code.google.com/p/data-race-test/wiki/PopularDataRaces#Data_race_on_vptr ). Currently, I can figure out when a function is a DTOR and when a store touches vptr by analyzing mangled names. _ZN1BD1Ev=="B::~B()" _ZTV1B=="vtable for B" define linkonce_odr void @_ZN1BD1Ev(%struct.B* %this) unnamed_addr nounwind uwtable align 2 { entry: .... store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTV1B, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8 However, this does not sound...
2015 Jan 28
3
[LLVMdev] IR extension proposal: bitset constants
...suppose we have the following classes: >> >> struct A { virtual void f(); }; >> struct B : A { virtual void f(), g(); }; >> struct C : A { virtual void f(), h(); }; >> >> with the following vtables: >> >> _ZTV1A = { &A::rtti, &A::f }; >> _ZTV1B = { &B::rtti, &B::f, &B::g }; >> _ZTV1C = { &C::rtti, &C::f, &C::h }; >> >> The set of valid vtables for static class A is {&_ZTV1A[1], &_ZTV1B[1], >> &_ZTV1C[1]}, for B is {&_ZTV1B[1]} and for C is {&_ZTV1C[1]}. The >> toolc...
2015 Jan 29
3
[LLVMdev] IR extension proposal: bitset constants
...rtual void f(); }; > > >> struct B : A { virtual void f(), g(); }; > > >> struct C : A { virtual void f(), h(); }; > > >> > > >> with the following vtables: > > >> > > >> _ZTV1A = { &A::rtti, &A::f }; > > >> _ZTV1B = { &B::rtti, &B::f, &B::g }; > > >> _ZTV1C = { &C::rtti, &C::f, &C::h }; > > >> > > >> The set of valid vtables for static class A is {&_ZTV1A[1], > &_ZTV1B[1], > > >> &_ZTV1C[1]}, for B is {&_ZTV1B[1]} and...
2012 Mar 19
0
[LLVMdev] recognizing DTORs and vptr updates in LLVM.
...eed to distinguish benign and harmful races on vptr (http://code.google.com/p/data-race-test/wiki/PopularDataRaces#Data_race_on_vptr). > > Currently, I can figure out when a function is a DTOR and when a store touches vptr by analyzing mangled names. > _ZN1BD1Ev=="B::~B()" > _ZTV1B=="vtable for B" > > define linkonce_odr void @_ZN1BD1Ev(%struct.B* %this) unnamed_addr nounwind uwtable align 2 { > entry: > .... > store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTV1B, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8 >...
2016 Jun 01
5
RFC: a renaming/redesign for LLVM's bitset metadata
...would look, suppose that we have the following declarations: class A { virtual void f() {} }; class B : public A { virtual void f() {} virtual void g() {} }; The vtables for A and B would be represented in IR like this: @_ZTV1A = constant [3 x i8*] [i8* ..., i8* ..., i8* @A::f], !type !0 @_ZTV1B = constant [4 x i8*] [i8* ..., i8* ..., i8* @B::f, i8* @B::g], type !0, !type !1 !0 = {i64 16, !"A"} !1 = {i64 16, !"B"} The metadata !0 indicates that the attached global has an address point for the type A at byte offset 16, and metadata !1 indicates that the attached global...
2015 Jan 30
0
[LLVMdev] IR extension proposal: bitset constants
...> To give a concrete example, suppose we have the following classes: > > struct A { virtual void f(); }; > struct B : A { virtual void f(), g(); }; > struct C : A { virtual void f(), h(); }; > > with the following vtables: > > _ZTV1A = { &A::rtti, &A::f }; > _ZTV1B = { &B::rtti, &B::f, &B::g }; > _ZTV1C = { &C::rtti, &C::f, &C::h }; > > The set of valid vtables for static class A is {&_ZTV1A[1], &_ZTV1B[1], > &_ZTV1C[1]}, for B is {&_ZTV1B[1]} and for C is {&_ZTV1C[1]}. The toolchain > would lay out...
2015 Jan 31
2
[LLVMdev] IR extension proposal: bitset constants
...oid f(); }; class B : A { virtual void f(); }; class C : A { virtual void f(); }; would have these bitsets: !llvm.bitsets = !{!0, !1, !2, !3, !4} !0 = !{!"1A", i8* getelementptr inbounds ([3 x i8*]* @_ZTV1A, i32 0, i32 2)} !1 = !{!"1A", i8* getelementptr inbounds ([3 x i8*]* @_ZTV1B, i32 0, i32 2)} !2 = !{!"1A", i8* getelementptr inbounds ([3 x i8*]* @_ZTV1C, i32 0, i32 2)} !3 = !{!"1B", i8* getelementptr inbounds ([3 x i8*]* @_ZTV1B, i32 0, i32 2)} !4 = !{!"1C", i8* getelementptr inbounds ([3 x i8*]* @_ZTV1C, i32 0, i32 2)} The LLVM linker can a...
2012 Mar 19
0
[LLVMdev] recognizing DTORs and vptr updates in LLVM.
...istinguish benign and harmful races on vptr > (http://code.google.com/p/data-race-test/wiki/PopularDataRaces#Data_race_on_vptr). > > Currently, I can figure out when a function is a DTOR and when a store > touches vptr by analyzing mangled names. > _ZN1BD1Ev=="B::~B()" > _ZTV1B=="vtable for B" > > define linkonce_odr void @_ZN1BD1Ev(%struct.B* %this) unnamed_addr nounwind > uwtable align 2 { > entry: >   .... >   store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* > @_ZTV1B, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, alig...
2015 Jan 31
0
[LLVMdev] IR extension proposal: bitset constants
...; }; > class C : A { virtual void f(); }; > > would have these bitsets: > > !llvm.bitsets = !{!0, !1, !2, !3, !4} > > !0 = !{!"1A", i8* getelementptr inbounds ([3 x i8*]* @_ZTV1A, i32 0, i32 > 2)} > !1 = !{!"1A", i8* getelementptr inbounds ([3 x i8*]* @_ZTV1B, i32 0, i32 > 2)} > !2 = !{!"1A", i8* getelementptr inbounds ([3 x i8*]* @_ZTV1C, i32 0, i32 > 2)} > !3 = !{!"1B", i8* getelementptr inbounds ([3 x i8*]* @_ZTV1B, i32 0, i32 > 2)} > !4 = !{!"1C", i8* getelementptr inbounds ([3 x i8*]* @_ZTV1C, i32 0,...
2012 Mar 19
5
[LLVMdev] recognizing DTORs and vptr updates in LLVM.
...istinguish benign and harmful races on vptr > (http://code.google.com/p/data-race-test/wiki/PopularDataRaces#Data_race_on_vptr). > > Currently, I can figure out when a function is a DTOR and when a store > touches vptr by analyzing mangled names. > _ZN1BD1Ev=="B::~B()" > _ZTV1B=="vtable for B" > > define linkonce_odr void @_ZN1BD1Ev(%struct.B* %this) unnamed_addr nounwind > uwtable align 2 { > entry: >   .... >   store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* > @_ZTV1B, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, alig...
2012 Mar 20
1
[LLVMdev] recognizing DTORs and vptr updates in LLVM.
...ish benign and harmful races on vptr ( > http://code.google.com/p/data-race-test/wiki/PopularDataRaces#Data_race_on_vptr > ). > > Currently, I can figure out when a function is a DTOR and when a store > touches vptr by analyzing mangled names. > _ZN1BD1Ev=="B::~B()" > _ZTV1B=="vtable for B" > > define linkonce_odr void @_ZN1BD1Ev(%struct.B* %this) unnamed_addr > nounwind uwtable align 2 { > entry: > .... > store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* > @_ZTV1B, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, alig...
2015 Jan 31
0
[LLVMdev] IR extension proposal: bitset constants
Trying to summarize all opinions expressed here: Peter is proposing an initial implementation that would only work with LTO. Folks seem put off by this implementation affecting IR without having proven itself, and having shortcomings (as Jim pointed out). Kostya proposed going through metadata (and Chris kind of did too by mentioning tbaa), but Peter points out that this will make the
2017 Dec 07
2
devirtualization with new-PM pipeline
...b = alloca %struct.B, align 8   %0 = bitcast %struct.B* %b to i8*   call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %0) #3   %1 = getelementptr inbounds %struct.B, %struct.B* %b, i64 0, i32 0, i32 0   store i32 (...)** bitcast (i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTV1B, i64 0, inrange i32 0, i64 2) to i32 (...)**), i32 (...)*** %1, align 8, !tbaa !2   %call.i = call i32 @_ZN1B5virt1Ev(%struct.B* nonnull %b)   call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %0) #3   ret i32 %call.i } ... ] clang++ --version clang version 6.0.0 (trunk 319748) (llvm/trunk 3...
2012 Mar 22
0
[LLVMdev] recognizing DTORs and vptr updates in LLVM.
...imple C/C++ TBAA", null} ... Load: %0 = bitcast %struct.A* %a to void (%struct.A*)*** %vtable = load void (%struct.A*)*** %0, align 8, !tbaa !0 Store: %0 = getelementptr inbounds %struct.B* %this, i64 0, i32 0, i32 0 store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTV1B, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8, !tbaa !0 --kcc On Wed, Mar 21, 2012 at 12:57 PM, Chris Lattner <clattner at apple.com> wrote: > > On Mar 21, 2012, at 11:53 AM, Kostya Serebryany wrote: > > > The gcc Ada front-end does this too, in quite a range...
2011 Dec 09
0
[LLVMdev] Implementing devirtualization
...!66) >   tail call void @llvm.dbg.value(metadata !76, i64 0, metadata !67) >   %7 = getelementptr inbounds i8* %6, i64 8 >   %8 = bitcast i8* %7 to i32* >   store i32 2, i32* %8, align 4, !tbaa !72 >   %9 = bitcast i8* %6 to i8*** >   store i8** getelementptr inbounds ([5 x i8*]* @_ZTV1B, i64 0, i64 2), > i8*** %9, align 8 >   tail call void @llvm.dbg.value(metadata !{null}, i64 0, metadata !52), > !dbg !75 >   %10 = bitcast i8* %1 to i32 (%class.A*)***, !dbg !77 >   %11 = load i32 (%class.A*)*** %10, align 8, !dbg !77 >   %12 = load i32 (%class.A*)** %11, align 8...
2011 Dec 09
1
[LLVMdev] Implementing devirtualization
...l void @llvm.dbg.value(metadata !76, i64 0, metadata !67) >>   %7 = getelementptr inbounds i8* %6, i64 8 >>   %8 = bitcast i8* %7 to i32* >>   store i32 2, i32* %8, align 4, !tbaa !72 >>   %9 = bitcast i8* %6 to i8*** >>   store i8** getelementptr inbounds ([5 x i8*]* @_ZTV1B, i64 0, i64 2), >> i8*** %9, align 8 >>   tail call void @llvm.dbg.value(metadata !{null}, i64 0, metadata !52), >> !dbg !75 >>   %10 = bitcast i8* %1 to i32 (%class.A*)***, !dbg !77 >>   %11 = load i32 (%class.A*)*** %10, align 8, !dbg !77 >>   %12 = load i32 (%...
2011 Dec 08
2
[LLVMdev] Implementing devirtualization
...data !{null}, i64 0, metadata !66) tail call void @llvm.dbg.value(metadata !76, i64 0, metadata !67) %7 = getelementptr inbounds i8* %6, i64 8 %8 = bitcast i8* %7 to i32* store i32 2, i32* %8, align 4, !tbaa !72 %9 = bitcast i8* %6 to i8*** store i8** getelementptr inbounds ([5 x i8*]* @_ZTV1B, i64 0, i64 2), i8*** %9, align 8 tail call void @llvm.dbg.value(metadata !{null}, i64 0, metadata !52), !dbg !75 %10 = bitcast i8* %1 to i32 (%class.A*)***, !dbg !77 %11 = load i32 (%class.A*)*** %10, align 8, !dbg !77 %12 = load i32 (%class.A*)** %11, align 8, !dbg !77 %13 = tail call i...
2015 Jan 31
2
[LLVMdev] IR extension proposal: bitset constants
...; }; > > > > would have these bitsets: > > > > !llvm.bitsets = !{!0, !1, !2, !3, !4} > > > > !0 = !{!"1A", i8* getelementptr inbounds ([3 x i8*]* @_ZTV1A, i32 0, i32 > > 2)} > > !1 = !{!"1A", i8* getelementptr inbounds ([3 x i8*]* @_ZTV1B, i32 0, i32 > > 2)} > > !2 = !{!"1A", i8* getelementptr inbounds ([3 x i8*]* @_ZTV1C, i32 0, i32 > > 2)} > > !3 = !{!"1B", i8* getelementptr inbounds ([3 x i8*]* @_ZTV1B, i32 0, i32 > > 2)} > > !4 = !{!"1C", i8* getelementptr inbound...
2017 Dec 14
2
devirtualization with new-PM pipeline
...= bitcast %struct.B* %b to i8* > > call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %0) #3 > > %1 = getelementptr inbounds %struct.B, %struct.B* %b, i64 0, i32 0, > i32 0 > > store i32 (...)** bitcast (i8** getelementptr inbounds ({ [3 x i8*] }, > { [3 x i8*] }* @_ZTV1B, i64 0, inrange i32 0, i64 2) to i32 (...)**), i32 > (...)*** %1, align 8, !tbaa !2 > > %call.i = call i32 @_ZN1B5virt1Ev(%struct.B* nonnull %b) > > call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %0) #3 > > ret i32 %call.i > > } > > ... > > ] clang...