search for: getbitwidth

Displaying 20 results from an estimated 20 matches for "getbitwidth".

2008 Jul 07
0
[LLVMdev] (GEP) Index validity
...ConstantInt *CU = dyn_cast<ConstantInt>(V)) + return indexValid(CU->getZExtValue()); return false; } @@ -1530,9 +1529,8 @@ } bool SequentialType::indexValid(const Value *V) const { - if (const IntegerType *IT = dyn_cast<IntegerType>(V->getType())) - return IT->getBitWidth() == 32 || IT->getBitWidth() == 64; - return false; + // Any integer value is allowed + return V->getType()->isInteger(); } namespace llvm { Index: lib/Target/TargetData.cpp =================================================================== --- lib/Target/TargetData.cpp (revision 5...
2008 Jul 10
2
[LLVMdev] (GEP) Index validity
...> + return indexValid(CU->getZExtValue()); > return false; > } > > @@ -1530,9 +1529,8 @@ > } > > bool SequentialType::indexValid(const Value *V) const { > - if (const IntegerType *IT = dyn_cast<IntegerType>(V->getType())) > - return IT->getBitWidth() == 32 || IT->getBitWidth() == 64; > - return false; > + // Any integer value is allowed > + return V->getType()->isInteger(); > } > > namespace llvm { > Index: lib/Target/TargetData.cpp > =================================================================== &...
2008 Jul 07
2
[LLVMdev] (GEP) Index validity
Hi all, I'm fiddling around a bit with programmatically created GEP instructions, which is failing when using i64 for any indix, except the first. The reason behind this, is that StructureType::indexValid only accepts Value* that are constant ints of width 32. I can't really see why this limitation is here. SequentialType solves this slightly differently, it allows for both 32 and 64
2011 Nov 23
3
[LLVMdev] [llvm-commits] Vectors of Pointers and Vector-GEP
...supported at this point. 5. The getelementptr indices must all be vectors, if the pointer operand is a vector of pointers. Regarding your specific comments, Vectors of pointers are a new type in LLVM, so I believe that any predictable and sensible behavior is acceptable. Much like pointers, 'getBitWidth' should return zero. In my current patch bitcasting of one vector pointer to another vector pointer of the same length is okay, but any other bitcast is invalid. I added an assert to getInteger to prevent calling 'getInteger' on vectors of pointers. I agree that IntToPtr and PtrToInt ne...
2011 Feb 15
3
[LLVMdev] Structure Types and ABI sizes
Hi all, We're hitting some walls here when generating the correct structure layout for specific C++ ABI requirements, and I was wondering how much StructLayout could help. For instance, the ABI has some complicated rules on the size of derived classes (http://www.codesourcery.com/public/cxx-abi/abi.html#class-types) and LLVM struct type cannot reflect that in full. Example: // CHECK:
2008 Jul 10
0
[LLVMdev] (GEP) Index validity
...(CU->getZExtValue()); >> return false; >> } >> >> @@ -1530,9 +1529,8 @@ >> } >> >> bool SequentialType::indexValid(const Value *V) const { >> - if (const IntegerType *IT = dyn_cast<IntegerType>(V->getType())) >> - return IT->getBitWidth() == 32 || IT->getBitWidth() == 64; >> - return false; >> + // Any integer value is allowed >> + return V->getType()->isInteger(); >> } >> >> namespace llvm { >> Index: lib/Target/TargetData.cpp >> =========================================...
2012 May 21
3
[LLVMdev] APInt::sdivrem error?
I wrote the following bit of code static APInt FloorOfQuotient(APInt a, APInt b) { unsigned bits = a.getBitWidth(); APInt q(bits, 1), r(bits, 1); APInt::sdivrem(a, b, q, r); * errs() << "sdivrem(" << a << ", " << b << ") = (" << q << ", " << r << ")\n"; * if (r == 0) return q; else { if ((a.sgt(0...
2007 Dec 07
0
[LLVMdev] Regression on <4 x i1>?
Duncan, could this be related to your recent work? Chuck, this is unlikely to be a x86 specific problem. Please file a bug. Thanks! Evan On Dec 6, 2007, at 5:06 PM, Chuck Rose III wrote: > Hola LLVMers, > > One of the corner-case features of the Hydra language I work on are > Boolean vectors of length 2, 3, or 4 which I’ve been representing as > either <2 x i1> or
2007 Dec 07
3
[LLVMdev] Regression on <4 x i1>?
Hola LLVMers, One of the corner-case features of the Hydra language I work on are Boolean vectors of length 2, 3, or 4 which I've been representing as either <2 x i1> or <4 x i1>. I picked up the latest LLVM about a week back and since then I've been unable to compile things using this construct. It asserts in TargetData::getAlignmentInfo since it doesn't have
2012 May 21
0
[LLVMdev] APInt::sdivrem error?
...orrect positive and negative results). And trying it with a 3rd true argument made no difference. Other ideas anyone? My only other clue is that bits = 64. Thanks, Preston > I wrote the following bit of code > > static APInt FloorOfQuotient(APInt a, APInt b) { > unsigned bits = a.getBitWidth(); > APInt q(bits, 1), r(bits, 1); > APInt::sdivrem(a, b, q, r); > errs() << "sdivrem(" << a << ", " << b << ") = (" << q << ", " << r << ")\n"; > if (r == 0) > return q; &g...
2012 May 21
0
[LLVMdev] APInt::sdivrem error?
...nt, Remainder); } } What should I do to submit the correction? Thanks, Preston On Sun, May 20, 2012 at 6:21 PM, Preston Briggs <preston.briggs at gmail.com> wrote: > I wrote the following bit of code > > static APInt FloorOfQuotient(APInt a, APInt b) { > unsigned bits = a.getBitWidth(); > APInt q(bits, 1), r(bits, 1); > APInt::sdivrem(a, b, q, r); > errs() << "sdivrem(" << a << ", " << b << ") = (" << q << ", " << r << > ")\n"; > if (r == 0) > return...
2009 Nov 25
0
[LLVMdev] JVM Backend
Hello, David First of all, thanks for the backend submission. I let Chris comment about the procedure of adding it to the tree. :) I just did a quick look into the code. The comments are below > Indirect function calls don't work yet, and there's probably some > minor bugs in it, but it works well for the test cases that I've run > through it. Could you please provide some
2009 Nov 26
2
[LLVMdev] JVM Backend
...arbitrary precision support be required for the initial commit of the backend? > Currently all > the things seems to behave different in case of receiving e.g. i31: > - functions like getTypeName() return some junk (the case > Type::IntegerTypeID just falls through to Type::FloatTyID) getBitWidth raises an assertion before this can happen. -- David Roberts http://da.vidr.cc/ On Wed, Nov 25, 2009 at 21:03, Anton Korobeynikov <anton at korobeynikov.info> wrote: > Hello, David > > First of all, thanks for the backend submission. I let Chris comment > about the procedure o...
2007 Jul 03
0
[LLVMdev] Solaris 9 compilation
..._iterator, llvm::ExecutionContext&)': /home/ggreif/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:798: warning: 'Idx' might be used uninitialized in this function 7) /home/ggreif/llvm/lib/Target/MSIL/MSILWriter.cpp: In member function `unsigned int <unnamed>::MSILWriter::getBitWidth(const llvm::Type*)': /home/ggreif/llvm/lib/Target/MSIL/MSILWriter.cpp:1449: warning: control reaches end of non-void function /home/ggreif/llvm/lib/Target/MSIL/MSILWriter.cpp: In member function `std::string <unnamed>::MSILWriter::getTypePostfix(const llvm::Type*, bool, bool)': /home/...
2007 Dec 15
2
[LLVMdev] fix warning with newer g++ compilers
...DigitOrNegative() { return LABELSTR; } } - + // If the next character is a '.', then it is a fp value, otherwise its // integer. if (CurPtr[0] != '.') { @@ -753,7 +756,7 @@ int LLLexer::LexDigitOrNegative() { Tmp.trunc(activeBits); if (Tmp.getBitWidth() > 64) { llvmAsmlval.APIntVal = new APInt(Tmp); - return EUAPINTVAL; + return EUAPINTVAL; } else { llvmAsmlval.UInt64Val = Tmp.getZExtValue(); return EUINT64VAL; @@ -762,20 +765,20 @@ int LLLexer::LexDigitOrNegative() { } ++CurPtr; - +...
2009 Nov 24
2
[LLVMdev] JVM Backend
Hi, I've written a backend for LLVM that allows LLVM IR to be transformed to a Java/JVM class file (llvm-jvm.patch.gz attached). Indirect function calls don't work yet, and there's probably some minor bugs in it, but it works well for the test cases that I've run through it. Also, several instructions are emulated by method calls due to deficiencies in the JVM instruction set
2012 Sep 26
0
[LLVMdev] [PATCH / PROPOSAL] bitcode encoding that is ~15% smaller for large bitcode files...
...I = BranchInst::Create(TrueDest, FalseDest, Cond); > InstructionList.push_back(I); > @@ -2276,9 +2293,10 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { > Type *OpTy = getTypeByID(Record[1]); > unsigned ValueBitWidth = cast<IntegerType>(OpTy)->getBitWidth(); > > - Value *Cond = getFnValueByID(Record[2], OpTy); > + Value *Cond; > BasicBlock *Default = getBasicBlock(Record[3]); > - if (OpTy == 0 || Cond == 0 || Default == 0) > + if (getValueConst(Record, 2, NextValueNo, OpTy, Cond) || > +...
2010 Mar 15
0
[LLVMdev] [patch] Writing ConstantUnions
...uint64_t Size = 0; + for (UnionType::element_iterator i = UnTy->element_begin(), + e = UnTy->element_end(); i != e; ++i) { + Size = std::max(Size, getTypeSizeInBits(*i)); + } + return Size; + } case Type::IntegerTyID: return cast<IntegerType>(Ty)->getBitWidth(); case Type::VoidTyID: @@ -516,6 +525,17 @@ unsigned Align = getAlignmentInfo(AGGREGATE_ALIGN, 0, abi_or_pref, Ty); return std::max(Align, (unsigned)Layout->getAlignment()); } + case Type::UnionTyID: { + const UnionType *UnTy = cast<UnionType>(Ty); + unsigned Align...
2010 Mar 15
3
[LLVMdev] [patch] Writing ConstantUnions
Hello, I noticed a bit of a gap in the current code for unions: a ConstantUnion cannot be written out to .ll. Hopefully I'm not stepping on Talin's toes by posting this, it's a fairly straightforward adaptation of the code for structs just above. Tim. -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. --------------
2012 Sep 26
9
[LLVMdev] [PATCH / PROPOSAL] bitcode encoding that is ~15% smaller for large bitcode files...
Hi all, I've been looking into how to make llvm bitcode files smaller. There is one simple change that appears to shrink linked bitcode files by about 15%. See this spreadsheet for some rough data: https://docs.google.com/spreadsheet/ccc?key=0AjRrJHQc4_bddEtJdjdIek5fMDdIdFFIZldZXzdWa0E The change is in how operand ids are encoded in bitcode files. Rather than use an "absolute