search for: getbitcast

Displaying 20 results from an estimated 33 matches for "getbitcast".

2011 Nov 24
1
[LLVMdev] differences in IR and ELF?
...vector<Constant *> v_elements; Type *elm_type = Type::getInt32PtrTy(M.getContext()); Constant *tmp = dyn_cast<Constant>(shadow); assert(tmp != NULL && "shadow"); v_elements.push_back(ConstantExpr::getBitCast(tmp, elm_type)); tmp = dyn_cast<Constant>(val); assert(tmp != NULL && "value"); v_elements.push_back(ConstantExpr::getBitCast(tmp, elm_type)); tmp = dyn_cast<Constant>(func); assert(tmp != NUL...
2012 Dec 19
2
[LLVMdev] GetElementPtrConstantExpr
Ok, now it's arising another problem. IR code that I obtain is the following: i8* bitcast ([5 x i8] c"hello\00" to i8*) generated from instructions: ConstantExpr::getBitCast (ConstantDataArray::getString (getGlobalContext (), "hello"), PointerType::get (Type::getInt8Ty (getGlobalContext ()), 0)) but the LLC tool says: invalid cast opcode for cast from '[5 x i8]' to 'i8*'. Any help? 2012/12/18 Óscar Fuentes <ofv at wanadoo.es> > A...
2012 Dec 19
0
[LLVMdev] GetElementPtrConstantExpr
...compile some C code that makes use of the address of a string using "clang -emit-llvm" to see how this can be done. Ciao, Duncan. PS: Unlike in C, in LLVM IR an array is not the same thing as a pointer to the first element. > > generated from instructions: > > ConstantExpr::getBitCast (ConstantDataArray::getString (getGlobalContext (), > "hello"), PointerType::get (Type::getInt8Ty (getGlobalContext ()), 0)) > > but the LLC tool says: invalid cast opcode for cast from '[5 x i8]' to 'i8*'. > > Any help? > > > 2012/12/18 Óscar Fuent...
2011 Oct 26
3
[LLVMdev] Use still stuck around after Def is destroyed:
I made a GlobalVariable that is of type ConstantArray. For one of it's elements I assigned it the ConstantExpr::getBitCast of another GlobalVariable(the "shadow pointer" mentioned). This gives me: While deleting: i32 (i32)** %Shadow Variable for ptr1 Use still stuck around after Def is destroyed:i8* bitcast (i32 (i32)** @"Shadow Variable for ptr1" to i8*) opt: Value.cpp:75:...
2011 Nov 15
0
[LLVMdev] constructing global array of pointers?
...vector<Constant *> v_elements; Type *elm_type = Type::getInt32PtrTy(M.getContext()); Constant *tmp = dyn_cast<Constant>(shadow); assert(tmp != NULL && "shadow"); v_elements.push_back(ConstantExpr::getBitCast(tmp, elm_type)); tmp = dyn_cast<Constant>(val); assert(tmp != NULL && "value"); v_elements.push_back(ConstantExpr::getBitCast(tmp, elm_type)); tmp = dyn_cast<Constant>(func); assert(tmp !...
2012 Dec 18
0
[LLVMdev] GetElementPtrConstantExpr
...8* in the instantiation of a > GlobalVariable. > I have the follow declaration: %xxx = type { i8* } and I must emit the > following variable: > @yyy = linkonce_odr constant %xxx { [4 x i8] c"hello\00" }, but it's wrong. > > How do I do? You can use the ConstantExpr::getBitCast static member function: http://llvm.org/doxygen/classllvm_1_1ConstantExpr.html#aba93ec4079f8d709a1d5b4745310782e This is a common idiom on LLVM: a base class has static methods for creating instances of derived classes.
2011 Nov 24
0
[LLVMdev] differences in IR and ELF?
...t;Constant *> v_elements; > Type *elm_type = Type::getInt32PtrTy(M.getContext()); > > Constant *tmp = dyn_cast<Constant>(shadow); > assert(tmp != NULL && "shadow"); > v_elements.push_back(ConstantExpr::getBitCast(tmp, > elm_type)); > > tmp = dyn_cast<Constant>(val); > assert(tmp != NULL && "value"); > v_elements.push_back(ConstantExpr::getBitCast(tmp, > elm_type)); > > tmp = dyn_cast<Constant>(func)...
2012 Dec 18
2
[LLVMdev] GetElementPtrConstantExpr
Because I need to convert an [4 x i8] type to i8* in the instantiation of a GlobalVariable. I have the follow declaration: %xxx = type { i8* } and I must emit the following variable: @yyy = linkonce_odr constant %xxx { [4 x i8] c"hello\00" }, but it's wrong. How do I do? 2012/12/18 Óscar Fuentes <ofv at wanadoo.es> > Alessio Giovanni Baroni <alessiogiovanni.baroni at
2007 Sep 20
0
[LLVMdev] Valgrind Help Needed
...7 Function *F = TheModule->getFunction(Name); 1088 assert(F && F->isDeclaration() && "A function turned into a global?"); 1089 1090 // Replace any uses of "F" with uses of GV. 1091 Value *FInNewType = ConstantExpr::getBitCast(GV, F- >getType()); (gdb) p Name $3 = 0x41819430 "\001L_OBJC_PROTOCOL_$_CPTransferThreadObserving" However TheModule->getFunction(Name) returns NULL and you get ICE at F->getType() #1091. I'll let you investigate this further ... :) - Devang -------------- next p...
2007 Sep 19
3
[LLVMdev] Valgrind Help Needed
Hi all, This program: @protocol CPTransferThreadObserving; @interface CPMode {} @end @implementation CPMode -(void) copyInBackgroundAndNotifyUsingPorts { id client; [client setProtocolForProxy: @protocol(CPTransferThreadObserving)]; } @end produces this internal compiler error: $ llvm-gcc -x objective-c -arch ppc64 -std=c99 -c testcase.mi testcase.mi:12: internal compiler
2011 Oct 26
0
[LLVMdev] Use still stuck around after Def is destroyed:
On Oct 26, 2011, at 12:18 PM, ret val wrote: > I made a GlobalVariable that is of type ConstantArray. For one of it's > elements I assigned it the ConstantExpr::getBitCast of another > GlobalVariable(the "shadow pointer" mentioned). This gives me: > > While deleting: i32 (i32)** %Shadow Variable for ptr1 > Use still stuck around after Def is destroyed:i8* bitcast (i32 > (i32)** @"Shadow Variable for ptr1" to i8*) >...
2007 Sep 20
2
[LLVMdev] Valgrind Help Needed
...TheModule->getFunction(Name); > 1088 assert(F && F->isDeclaration() && "A function turned > into a global?"); > 1089 > 1090 // Replace any uses of "F" with uses of GV. > 1091 Value *FInNewType = ConstantExpr::getBitCast(GV, F- > >getType()); > > > (gdb) p Name > $3 = 0x41819430 "\001L_OBJC_PROTOCOL_$_CPTransferThreadObserving" > > However TheModule->getFunction(Name) returns NULL and you get ICE > at F->getType() #1091. I'll let you investigate this further ......
2007 Sep 20
1
[LLVMdev] Valgrind Help Needed
...TheModule->getFunction(Name); > 1088 assert(F && F->isDeclaration() && "A function turned > into a global?"); > 1089 > 1090 // Replace any uses of "F" with uses of GV. > 1091 Value *FInNewType = ConstantExpr::getBitCast(GV, F- > >getType()); > > > (gdb) p Name > $3 = 0x41819430 "\001L_OBJC_PROTOCOL_$_CPTransferThreadObserving" > > However TheModule->getFunction(Name) returns NULL and you get ICE > at F->getType() #1091. I'll let you investigate this further ......
2007 Sep 20
0
[LLVMdev] Valgrind Help Needed
...nction(Name); >> 1088 assert(F && F->isDeclaration() && "A function >> turned into a global?"); >> 1089 >> 1090 // Replace any uses of "F" with uses of GV. >> 1091 Value *FInNewType = ConstantExpr::getBitCast(GV, F- >> >getType()); >> >> >> (gdb) p Name >> $3 = 0x41819430 "\001L_OBJC_PROTOCOL_$_CPTransferThreadObserving" >> >> However TheModule->getFunction(Name) returns NULL and you get ICE >> at F->getType() #1091. I'll let you...
2008 Apr 20
0
[LLVMdev] Global variable-length array
...x float] }* @f() { entry: ret { i32, [0 x float] }* bitcast ({ i32, [5 x float] }* @g to { i32, [0 x float] }*) } Internally to your front end, you could do the same thing: Declare the global early with its abstract type, and later when the concrete storage type is known, use ConstantExpr::getBitCast, replaceAllUsesWith, and takeName to do the same thing the linker did above. — Gordon -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080420/e09e159d/attachment.html>
2011 Oct 27
1
[LLVMdev] Use still stuck around after Def is destroyed:
...ther way I can go about this. On Wed, Oct 26, 2011 at 4:42 PM, Tanya Lattner <lattner at apple.com> wrote: > > On Oct 26, 2011, at 12:18 PM, ret val wrote: > > I made a GlobalVariable that is of type ConstantArray. For one of it's > elements I assigned it the ConstantExpr::getBitCast of another > GlobalVariable(the "shadow pointer" mentioned). This gives me: > >        While deleting: i32 (i32)** %Shadow Variable for ptr1 >        Use still stuck around after Def is destroyed:i8* bitcast (i32 > (i32)** @"Shadow Variable for ptr1" to i8*) >...
2014 Feb 27
3
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...on of bits. Otherwise method returns -1 or 1, defining total ordering between types in context of lossless bitcastability trait. E.g.: if L is less than R (result is -1), than every type that could be losslessly bitcasted to L is less than R. [/new comment] > > + /// Replacement for C1 == getBitCast(C2, C1Ty) > + /// Its more controllable, and supposed to be simpler and more > predictionable. > + /// As very important advantage: it allows to introduce order relation on > + /// constants set, and thus use it as trait in refinement routines. > > "Its" -->...
2020 Oct 01
3
Creating a global variable for a struct array
>The type you pass to GlobalVariable's constructor for that variable should be "[10 x %struct.dlist]" because that's what you want storage for. Then the GlobalVariable itself will be a Constant of type "[10 x %struct.dlist]*". Yes, I verified that this is the case. I enabled assertions and the error seems to occur while creating GlobalVariable for both struct dhash
2014 Jan 22
2
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
On 2014 Jan 22, at 07:35, Stepan Dyatkovskiy <stpworld at narod.ru> wrote: > Hi Raul and Duncan, > > Duncan, > Thank you for review. I hope to present fixed patch tomorrow. > > First, I would like to show few performance results: > > command: "time opt -mergefunc <test>" > > File: tramp3d-v4.ll, 12963 functions > Current
2018 Apr 10
1
64 bit mask in x86vshuffle instruction
...ons that will operate on all four // 128-bit lanes. SmallVector<int, 8> Repeated128Mask; if (is128BitLaneRepeatedShuffleMask(MVT::v32i64, Mask, Repeated128Mask)) { SmallVector<int, 64> PSHUFDMask; scaleShuffleMask(8, Repeated128Mask, PSHUFDMask); return DAG.getBitcast( MVT::v32i64, DAG.getNode(X86ISD::PSHUFD_P64, DL, MVT::v64i32, DAG.getBitcast(MVT::v64i32, V1), getV16X86ShuffleImm64ForMask(PSHUFDMask, DL, DAG))); } SmallVector<int, 16> Repeated256Mask; if (is256BitLaneRepeatedShu...