Displaying 20 results from an estimated 33 matches for "constantuint".
Did you mean:
constantint
2005 Mar 16
2
[LLVMdev] Dynamic Creation of a simple program
Hi Misha,
Thanks for your answer
I was doing this:
========================
BasicBlock *BBlock = new BasicBlock("entry", MyFunc);
...
Value *Zero = ConstantSInt::get(Type::IntTy, 0);
Value *UZero = ConstantUInt::get(Type::UIntTy, 0);
MallocInst* mi = new MallocInst( STyStru );
mi->setName("tmp.0");
BBlock->getInstList().push_back( mi );
GetElementPtrInst *m_Next = new GetElementPtrInst(mi, UZero, Zero, "tmp.3", BBlock );
...
========================
But I tried your c...
2002 Sep 23
2
[LLVMdev] Accessing constant indexes in GetElementPtr
...ase the indexes will be constants and I want
> to get the
> } constant values as an a native C int.
> }
> } Now I can iterate over all the indexes with idx_begin(). I can cast
> } all of the indexes to a ConstantIntegral. However, I cannot cast the
> } indexes to a ConstantSInt or ConstantUInt (cast<> throws an
> assertion) and
> } these two classes are the ones that have the getValue() method I need.
> }
> } Am I missing something here?
> }
> I'm not quite sure what particular problem you're having, but a few
> things to remember...
>
> - Not...
2005 Apr 11
2
[LLVMdev] JIT and array pointers
...you be a bit more specific
> about what you're trying to do?
>
> -Chris
>
Here is a basic example:
============================================
unsigned int buff[4096];
int main (void)
{
buff[0] = 1;
// compile and execute code that will change buff[0] to 2
Value *c0 = ConstantUInt::get (Type::UIntTy, 0);
Value *c2 = ConstantUInt::get (Type::UIntTy, 2);
Module *m = new Module ("test_module");
Function *f = m->getOrInsertFunction ("test_function", Type::VoidTy,
0);
BasicBlock *b = new BasicBlock ("entry_block", f);
// Here is the pr...
2002 Sep 22
2
[LLVMdev] Accessing constant indexes in GetElementPtr
...to access structure
elements. In this case the indexes will be constants and I want to get the
constant values as an a native C int.
Now I can iterate over all the indexes with idx_begin(). I can cast
all of the indexes to a ConstantIntegral. However, I cannot cast the
indexes to a ConstantSInt or ConstantUInt (cast<> throws an assertion) and
these two classes are the ones that have the getValue() method I need.
Am I missing something here?
Wojciech
2006 Jun 25
1
[LLVMdev] adding args to func call
...unction*, i is Instruction* */
Constant* constStr = ConstantArray::get("test\n");
GlobalVariable* gv = new GlobalVariable
(constStr->getType(), true, GlobalValue::InternalLinkage, constStr,
"", m);
std::vector<Constant*> geplist;
geplist.push_back(ConstantUInt::get(Type::UIntTy,0));
geplist.push_back(ConstantUInt::get(Type::UIntTy,0));
Constant* gep = ConstantExpr::getGetElementPtr(gv,geplist);
--
Jerry Hom
2006 May 01
0
[LLVMdev] printf decleration
...unction*, i is Instruction* */
Constant* constStr = ConstantArray::get("test\n");
GlobalVariable* gv = new GlobalVariable
(constStr->getType(), true, GlobalValue::InternalLinkage, constStr,
"", m);
std::vector<Constant*> geplist;
geplist.push_back(ConstantUInt::get(Type::UIntTy,0));
geplist.push_back(ConstantUInt::get(Type::UIntTy,0));
Constant* gep = ConstantExpr::getGetElementPtr(gv,geplist);
std::vector<Value*> args;
args.push_back(gep);
new CallInst(f, args, "", i);
Ryan M. Lefever wrote:
> I am writing a pass whe...
2002 Sep 25
3
[LLVMdev] question about GetElementPtr Instruction
I have a question about GetElementPtr.
Suppose I have an GetElementPtr Instruction GI:
%reg = getelementptr %ST* %s, uint 1, ubyte 2, ubyte 1, uint
5, uint 13
I want to check if this is the reference of a component of a
structure, how can I do that? Should I check which operand of
this instruction is 'ubyte' type? How can I do that in code?
should I use
ubyte *a =
2005 Apr 11
0
[LLVMdev] JIT and array pointers
...what you're trying to do. Below is some *pseudo* code for
the basic idea:
> ============================================
> unsigned int buff[4096];
>
> int main (void)
> {
> buff[0] = 1;
>
> // compile and execute code that will change buff[0] to 2
> Value *c0 = ConstantUInt::get (Type::UIntTy, 0);
> Value *c2 = ConstantUInt::get (Type::UIntTy, 2);
>
> Module *m = new Module ("test_module");
Here, create an LLVM GlobalVariable 'BuffGV' of the appropriate type, and
insert it into m:
GlobalVariable *BuffGV = new GlobalVariable([4096 x uint...
2006 May 01
2
[LLVMdev] printf decleration
I am writing a pass where I need to make a function deceleration for
printf. Below is the code I'm trying to use.
-----
bool MyPass::runOnModule(Module &m) {
vector<const Type*> args;
args.push_back(PointerType::get(Type::SByteTy));
Function* f = m.getOrInsertFunction("printf",
FunctionType::get(Type::IntTy, args, true));
-----
When I insert a call
2002 Sep 29
0
[LLVMdev] Re: llvm question
....def to see where they come
from.
> say i want it to be a eq or an ne. the next two parameters have to be
> values; i want to just put constants in there, like 1s or something, and i
> cannot for the life of me make that happen. i thought i'd figured out
> that
> (Value *) new ConstantUInt( Type::UIntTy, 1 )
> would give me a '1' for a constant, cast as a value, that i could use as
> one of the operands to my new SetCondInst(). but making a new
> constantuint is a protected operation and it won't let me do it.
Ok, yeah that won't work. Try this instead:
C...
2006 Mar 03
0
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
...e::UIntTy,
NULL);
+ }
std::vector<Value*> Ops;
Ops.push_back(CastToType(DestPtr, SBP));
Ops.push_back(CastToType(SrcPtr, SBP));
- Ops.push_back(CastToType(Size, Type::UIntTy));
+ Ops.push_back(CastToType(Size, IntPtr));
Ops.push_back(ConstantUInt::get(Type::UIntTy, Align));
new CallInst(MemCpy, Ops, "", CurBB);
}
@@ -811,14 +815,17 @@ void TreeToLLVM::EmitMemMove(Value *Dest
unsigned Align) {
const Type *SBP = PointerType::get(Type::SByteTy);
static Function *MemMove = 0;
- if (!MemMove)
-...
2006 May 17
0
[LLVMdev] Obfuscation with LLVM
..."dispatcher_main",
&currFunction, oldEntryBB );
// Add instructions that allocate and initialize the dispatcher's state
variable
// to the initialization block.
AllocaInst* statePtr = new AllocaInst( Type::UIntTy, 0, "state",
disInitBB );
new StoreInst( ConstantUInt::get( Type::UIntTy, firstBBIndex ),
statePtr, disInitBB );
new BranchInst( disMainBB, disInitBB ); // Connection to the
dispatcher's main block.
// Add instructions to the dispatcher's main block that implement
switching
// between the basic blocks depending on the state var...
2004 Apr 05
1
[LLVMdev] Two important changes to the getelementptr instruction
...code the integer type used in the bytecode file, which
takes space. Right now the type of the index is implicitly encoded into
the bytecode file based on what operand of the getelementptr it is.
Another advantage is that clients of the LLVM IR can assume that all
structure indexes are instances of ConstantUInt, which simplifies
construction and modification of the IR a bit.
-Chris
> On Sun, 2004-04-04 at 19:00, Chris Lattner wrote:
> > Hi all,
> >
> > I just checked in a series of patches that makes some substantial changes
> > to the LLVM getelementptr instruction. In parti...
2002 Sep 17
1
[LLVMdev] Compile error in InstrSelectionSupport.cpp
ISSUE: line 474 of InstrSelectionSupport.cpp is a conditional expression
of the form (<expr> ? (ConstantSInt*) : (ConstantUInt*)), which is an
unholy mixture of pointer types.
ACTION: Apply static_cast<Value*> to the two pointers, as the source
intends.
--
Casey Carter
Casey at Carter.net
ccarter at uiuc.edu
AIM: cartec69
-------------- next part --------------
An embedded and charset-unspecified text was scrub...
2006 Jun 30
1
[LLVMdev] instruction sequence
...*****************************
Constant* constStr = ConstantArray::get("test\n");
GlobalVariable* gv = new GlobalVariable
(constStr->getType(), true, GlobalValue::InternalLinkage, constStr,
"", MP);
std::vector<Constant*> geplist;
geplist.push_back(ConstantUInt::get(Type::UIntTy,0));
geplist.push_back(ConstantUInt::get(Type::UIntTy,0));
Constant* gep = ConstantExpr::getGetElementPtr(gv,geplist);
IP = new LoadInst(GVstderr, "loadstderr", IP);
IPstderr = IP;
std::vector<Value*> args;
args.push_back(IPstderr);
args.push...
2006 Sep 20
1
[LLVMdev] using the constant pool during select
...ying to do is to have a select function that checks the if
a constant can be an immediate and, if it can't, produces a load:
---------------------------------------------------------------------------------------
const Type *OpNTy = MVT::getTypeForValueType(MVT::i32);
Constant *C = ConstantUInt::get(OpNTy, t);
int alignment = 2;
SDOperand Addr = CurDAG->getTargetConstantPool(C, MVT::i32, alignment);
Arg = CurDAG->getLoad(MVT::i32, CurDAG->getEntryNode(), Addr,
CurDAG->getSrcValue(NULL));
------------------------------------------...
2006 Oct 20
0
[LLVMdev] SignlessTypes: Removal of Constant[SU]Int
All,
Just in case you're not on the llvm-commits list, the classes
ConstantSInt and ConstantUInt have been removed from the LLVM C++ IR.
This affects only the CVS HEAD. A patch to llvm-gcc4 to compensate for
this should be available in the next day or so, depending on when it
gets committed and updated.
If you're maintaining a language front end or other llvm-based software,
you'll pr...
2006 Nov 15
0
[LLVMdev] 1.9 Prerelease Available for Testing
...y a bug.
> Could you try doing a make first and then install? Please let me
> know if
> you have any more problems.
You were right. Doing a proper "make ; make install" did the trick.
After making necessary adjustments to my LLVM-app (due to
disappearing of ConstantSInt and ConstantUInt, and replacement of
RegisterOpt by RegisterPass), all its tests passed. Didn't check
LLVM's test suite.
Kind regards,
Bram Adams
GH-SEL, INTEC, Ghent University
2006 Nov 15
3
[LLVMdev] 1.9 Prerelease Available for Testing
> When building LLVM 1.9 on OSX 10.4.8, I get (after a while, see attachment):
>
> make[1]: *** No rule to make target `/path/to/llvm-build/Debug/bin/tblgen',
> needed by `/path/to/llvm-build/lib/VMCore/Debug/Intrinsics.gen.tmp'. Stop.
> make: *** [install] Error 1
>
> when doing:
>
> $LLVM_SRC/configure --prefix=$LLVM_INSTALL --with-llvmgccdir=$LLVM_FRONT
2005 Apr 11
0
[LLVMdev] JIT and array pointers
On Mon, 11 Apr 2005, Paul wrote:
> I'm trying to pass an array pointer to my run-time generated module, and
> after a long time of searching for the answer, the only thing I got was
> a headache. Basically I have a few arrays (few megabytes which will
> sometimes be accessed as 8 / 16 / 32 / 64 bit binary / fp values), that
> will be modified by both the generated module, and my