search for: gettyp

Displaying 20 results from an estimated 869 matches for "gettyp".

Did you mean: gettype
2010 Jan 18
5
[LLVMdev] [patch] Union Types - work in progress
...stantUnion ctor or ConstantUnion::get should assert that the constant has type that matches one of the elements of the union. @@ -928,7 +949,7 @@ /// if the elements of the array are all ConstantInt's. bool ConstantArray::isString() const { // Check the element type for i8... - if (!getType()->getElementType()->isInteger(8)) + if (getType()->getElementType() != Type::getInt8Ty(getContext())) return false; // Check the elements to make sure they are all integers, not constant // expressions. You have a couple of these things which revert a recent patch, plea...
2010 Jan 28
0
[LLVMdev] [patch] Union Types - work in progress
...nion::get should assert that the > constant has type that matches one of the elements of the union. > > @@ -928,7 +949,7 @@ > /// if the elements of the array are all ConstantInt's. > bool ConstantArray::isString() const { > // Check the element type for i8... > - if (!getType()->getElementType()->isInteger(8)) > + if (getType()->getElementType() != Type::getInt8Ty(getContext())) > return false; > // Check the elements to make sure they are all integers, not constant > // expressions. > > You have a couple of these things which revert...
2010 Jan 28
0
[LLVMdev] [patch] Union Types - work in progress
...nion::get should assert that the > constant has type that matches one of the elements of the union. > > @@ -928,7 +949,7 @@ > /// if the elements of the array are all ConstantInt's. > bool ConstantArray::isString() const { > // Check the element type for i8... > - if (!getType()->getElementType()->isInteger(8)) > + if (getType()->getElementType() != Type::getInt8Ty(getContext())) > return false; > // Check the elements to make sure they are all integers, not constant > // expressions. > > You have a couple of these things which revert...
2010 Jan 16
0
[LLVMdev] [patch] Union Types - work in progress
OK here's the patch for real this time :) On Fri, Jan 15, 2010 at 4:36 PM, Talin <viridia at gmail.com> wrote: > Here's a work in progress of the union patch. Note that the test "union.ll" > does not work, so you probably don't want to check this in as is. However, > I'd be interested in any feedback you're willing to give. > > -- > -- Talin
2010 Jan 16
2
[LLVMdev] [patch] Union Types - work in progress
Here's a work in progress of the union patch. Note that the test "union.ll" does not work, so you probably don't want to check this in as is. However, I'd be interested in any feedback you're willing to give. -- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL:
2009 May 17
1
[LLVMdev] [patch] Remove getType() overrides from extractvalue and insertvalue
Several instruction classes override getType() when the instruction always creates a particular type of value. For example, the result of insertelement is always a vector, so InsertElementInst overrides getType() to return a VectorType*. This makes perfect sense. However, ExtractValueInst and InsertValueInst override getType() to...
2012 Jul 26
1
[LLVMdev] Calling a function with bad signature, possible bug.
...unction. But I don't have any problems with my pass if I run clang -emit-llvm -S, then llc and then gcc. With this approach I get a binary with my instrumentation inserted. This line causes a problem - assert((i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"); I tried to get a dump of FTy->getParamType(i) and Args[i]->getType(), but I wasn't able to do it in gdb - everytime I create a breakpoint it just misses it. So I made the following: FTy->getParamType(i...
2010 Feb 10
3
[LLVMdev] [patch] Union Types - work in progress
...the >> constant has type that matches one of the elements of the union. >> >> @@ -928,7 +949,7 @@ >> /// if the elements of the array are all ConstantInt's. >> bool ConstantArray::isString() const { >> // Check the element type for i8... >> - if (!getType()->getElementType()->isInteger(8)) >> + if (getType()->getElementType() != Type::getInt8Ty(getContext())) >> return false; >> // Check the elements to make sure they are all integers, not constant >> // expressions. >> >> You have a couple of t...
2013 Aug 02
0
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
...he input bc file after -O3 optimization : > bzip2.del.opt.bc.tgz > > > Command to run on -O3 optimized file: llc -cppgen=program > bzip2.del.opt.bc > > Call stack: > > llc: Value.cpp:307: void > llvm::Value::replaceAllUsesWith(llvm::Value*): Assertion > `New->getType() == getType() && "replaceAllUses of value with new > value of different type!"' failed. > 0 llc 0x00000000014c716a > llvm::sys::PrintStackTrace(_IO_FILE*) + 38 > 1 llc 0x00000000014c73d1 > 2 llc 0x00000000014c7718 > 3...
2019 Sep 26
2
ConstantFP->getType() is not right
Hi, I want to create a double constant from a float constant, here's my code: auto* constFloat1 = static_cast<llvm::ConstantFP*>(llvm::ConstantFP::get(llvm::Type::getFloatTy(context), 3.1)); assert(constFloat1->getType() == llvm::Type::getFloatTy(context)); auto* constFloat2 = llvm::ConstantFP::get(llvm::Type::getDoubleTy(context), constFloat1->getValueAPF()); assert(constFloat2->getType() == llvm::Type::getDoubleTy(context)); but the second assert failed, the type of constFloat2 is still float, no...
2013 Jul 29
2
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
...re -O3 optimization :bzip2.del.bc.tgz I have attached the input bc file after -O3 optimization : bzip2.del.opt.bc.tgz Command to run on -O3 optimized file: llc -cppgen=program bzip2.del.opt.bc Call stack: llc: Value.cpp:307: void llvm::Value::replaceAllUsesWith(llvm::Value*): Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed. 0 llc 0x00000000014c716a llvm::sys::PrintStackTrace(_IO_FILE*) + 38 1 llc 0x00000000014c73d1 2 llc 0x00000000014c7718 3 libpthread.so.0 0x00000033306...
2013 Aug 09
0
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
...> >>> >>> Command to run on -O3 optimized file: llc -cppgen=program >>> bzip2.del.opt.bc >>> >>> Call stack: >>> >>> llc: Value.cpp:307: void >>> llvm::Value::replaceAllUsesWith(llvm::Value*): Assertion >>> `New->getType() == getType() && "replaceAllUses of value with new >>> value of different type!"' failed. >>> 0 llc 0x00000000014c716a >>> llvm::sys::PrintStackTrace(_IO_FILE*) + 38 >>> 1 llc 0x00000000014c73d1 >>> 2 ll...
2002 Sep 17
3
[LLVMdev] questions
...would you please clarify some problems I have? 1. If I see this instruction in the function. %S.i = alloca %struct.SimpleStruct Suppose SimpleStruct is as following: struct.SimpleStruct = type { int, double } When I read the instruction, how can I know the type of simplstruct, should I use 'getType' member function like Inst.getType()? If I use that, I will get a PointerType, how can I use it? 2. Another question is that since we do the scalar replacement on each function. If the program look like this. struct s { int a; float b; } fun1( struct s *ps) { ps->a = 1; ps-&gt...
2013 Aug 02
2
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
...: >> bzip2.del.opt.bc.tgz >> >> >> Command to run on -O3 optimized file: llc -cppgen=program >> bzip2.del.opt.bc >> >> Call stack: >> >> llc: Value.cpp:307: void >> llvm::Value::replaceAllUsesWith(llvm::Value*): Assertion >> `New->getType() == getType() && "replaceAllUses of value with new >> value of different type!"' failed. >> 0 llc 0x00000000014c716a >> llvm::sys::PrintStackTrace(_IO_FILE*) + 38 >> 1 llc 0x00000000014c73d1 >> 2 llc 0x0000...
2012 Dec 21
2
[LLVMdev] assert in InnerLoopVectorizer::createEmptyLoop
...ile the attached program with clang: $ clang -fno-strict-aliasing -target mips64el-unknown-linux -O3 -fomit-frame-pointer -S test1.c -o test1.ll -emit-llvm It asserts when LoopVectorize.cpp:506 is executed. It looks like it is complaining because it is trying to zero-extend an i64 (type Count->getType() returns i64) to an i32 (IdxTy). if (Count->getType() != IdxTy) { // The exit count can be of pointer type. Convert it to the correct // integer type. if (ExitCount->getType()->isPointerTy()) Count = CastInst::CreatePointerCast(Count, IdxTy, "ptrcnt.to.int",...
2012 Sep 20
5
[LLVMdev] How To Get The Name of the type the popinter is pointing to
I want to know the type of pointer . for example if we have int *p, struct node *w char *q then i want int for p,char for q , struct node for w. any help would be appreciated. -- View this message in context: http://llvm.1065342.n5.nabble.com/How-To-Get-The-Name-of-the-type-the-popinter-is-pointing-to-tp49121.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
2012 Sep 21
0
[LLVMdev] How To Get The Name of the type the popinter is pointing to
i am using llvm , i did this if ( AllocaInst *allocInst = dyn_cast<AllocaInst>(&*bbit)){ PointerType *p = allocInst->getType(); if ( p->getElementType()->isPointerTy()){ StringRef name = allocInst->getName(); Type *type = allocInst->getOperand(0)->getType();;...
2008 Apr 21
2
[LLVMdev] newbie question for type comparison
...ct.S", where $struct.S is defined as a struct %struct.S = type { i32, i32 } I'm using the following loop: for(inst_iterator i = inst_begin(F), e = inst_end(F); i!= e; i++) { AllocaInst* ai; if( (ai = dyn_cast<AllocaInst>(&*i))){ if(ai->getOperand(0)->getType()->getTypeID() == Type::StructTyID) allocs.push_back(ai); } } However, I had the impression that the type comparison can be done by a pointer comparison. Can anyone please suggest me a better way to do it? Also, I want to get the size of %struct.S, should I use the following co...
2008 Apr 21
3
[LLVMdev] newbie question for type comparison
...s to use both methods, get ALL struct allocation and a SPECIFIC struct allocation, at different situations. Here, I've got a couple of more questions. 1. For getting ALL struct allocation, when I use if( (AI = dyn_cast<AllocaInst>(&*i))) if(AI->getOperand(0)->getType()->getTypeID() == Type::StructTyID) { to get all alloca instructions allocating a structure, it does not work. In my gdb session, I've got the following dumps: (gdb) call AI->dump() %s = alloca %struct.S ; <%struct.S*> [#uses=4] (gdb) call AI->getOperand(0)-...
2009 Apr 07
3
[LLVMdev] Patch: MSIL backend global pointers initialization
...e() operator for this but I'll > > appreciate any hints. > Why do you need this? Won't be enough just to compare function types? I do something like this: static bool areSame(Instruction *A, Instruction *B) { if (A->getOpcode() != B->getOpcode()) return false; if (A->getType()->getTypeID() != B->getType()->getTypeID()) return false; unsigned int a = A->getNumOperands(); if (a != B->getNumOperands()) return false; for (unsigned int i = 0; i < a; ++i) if (A->getOperand(i)->getType()->getTypeID() != B->getOperand(i)->getTy...