Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] ConstantExpr Handling?"
2011 Oct 27
2
[LLVMdev] ConstantExpr Evaluation
Hi,
What I'm currently working on is a translation from LLVM IR to a
register transfer list format used in VPO.
If my understanding of ConstantExpr is correct, that they can be
evaluated at compile-time, how can I simply have them be evaluated but
have the code still remain in IR format?
For example, in:
store i32 1, i32* getelementptr [6 x i32]* @arr, i32 0, i32 0
the getelementptr
2012 Jul 01
0
[LLVMdev] ConstantExpr refactoring
Renato Golin wrote:
> Hi all,
>
> It's been a long time, and I'm probably going to kill myself, but I
> want to try it anyway.
I don't think that turning off folding of constants is the right place
to start. To implement this, start by adding new constants that are
going to replace the existing ones. A good rule of thumb is "whatever
the relocations in a given
2004 Jun 17
4
[LLVMdev] generating instructions with embedded ConstantExprs from within LLVM
How is this done? Everything logical I have tried has failed, here was one attempt:
Constant *C = (Constant*) ConstantArray::get(inst2string(I)); //fucnction defined elsewhere
//generates a correct Global string
GlobalVariable *str = new GlobalVariable(C->getType(), true,
GlobalValue::InternalLinkage,
C, mkStrName( strNumber++ ), &M);
std::vector<Value*>
2012 Jun 29
6
[LLVMdev] ConstantExpr refactoring
Hi all,
It's been a long time, and I'm probably going to kill myself, but I
want to try it anyway.
Bug 10368 [1] tells me that ConstantExpr shouldn't automatically fold,
and that this is source of many problems (most notably with traps) and
code duplication.
However, I'm a bit lost... There seem to be constant folding in many places like
ConstantExpr::get*() uses
2011 Sep 24
2
[LLVMdev] Reading Static Values
Hi,
I'm currently trying to translate LLVM IR language to VPO .dec file
specification. I'm using LLVM source parser in the same way that it is
used in tools llc or llvm-as. One issue I'm having is I cannot find
any static values. For example, in a global declaration i.e. '@a =
global i32 7, align 4' I cannot get '7' from the parsed structure.
Similarly (sort
2004 Jun 17
0
[LLVMdev] generating instructions with embedded ConstantExprs from within LLVM
On Thu, 17 Jun 2004, Patrick Meredith wrote:
> How is this done? Everything logical I have tried has failed, here was
> one attempt:
Can you give a few more details about what you are doing? Are you running
the verifier before writing out bytecode? Is your code operating as a
pass? Can you send a dump of the generated LLVM code?
> Constant *C = (Constant*)
2009 Sep 22
0
[LLVMdev] DebugFactory
On Tue, Sep 22, 2009 at 9:21 AM, Devang Patel <devang.patel at gmail.com>wrote:
> On Tue, Sep 22, 2009 at 9:21 AM, Devang Patel <devang.patel at gmail.com>
> wrote:
> > On Tue, Sep 22, 2009 at 12:14 AM, Talin <viridia at gmail.com> wrote:
> >> So, one feature of the late, lamented DebugInfoBuilder that I am missing
> >> quite badly, and which is not
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.
--------------
2014 Apr 22
2
[LLVMdev] InstCombine strips the inBounds attribute in GetElementPtr ConstantExpr
I can't upload my program due to confidentiality, but the problem is
obvious.
At lib/Analysis/ConstantFolding.cpp:646
Constant *C = ConstantExpr::getGetElementPtr(Ops[0], NewIdxs);
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
if (Constant *Folded = ConstantFoldConstantExpression(CE, TD, TLI))
C = Folded;
}
The generated ConstantExpr C doesn't inherit the
2015 Dec 14
3
Getting TargetLowering in AsmPrinter / Lowering constant addrspacecast
Hi,
I'd like to add support for addrspacecast in initializers of global
variables, at least for the trivial case. The trivial case is if
TargetLowering::isNoopAddrSpaceCast(SrcAS, DestAS) returns true. In
this case the MCExpr for the addrspacecast is the MCExpr of its first
operand.
It seems hard to obtain an instance of TargetLowering in
AsmPrinter::lowerConstant(). Other methods in
2012 Jul 04
2
[LLVMdev] Bogus assert in VMCore/Instructions.cpp CallInst::Create?
Evening,
I was writing some code that tried to insert calls to the
llvm.annotation intrinsic function, which has a signature of (i32,
i8*, i8*, i32). The code is below.
void addAnnotation( BasicBlock *block, Function *F)
{
string foo = "foo";
string bar = "barr";
Type *charTy = Type::getInt8Ty(block->getContext());
ArrayType *s1Ty =
2015 Mar 07
2
[LLVMdev] cannot understand global c++API code
Hi all,
translating the following c code to llvm c++Api code, I can not understand
the result.
Perhaps someone could explain it to me.
c code
---------------------------------
struct stest {
int age;
float weight;
} foo={44,67.2};
int main() {
foo.weight=68.2;
...
----------------------------------------
API code
// this is clear
ConstantFP* const_float_102 =
2009 Sep 23
2
[LLVMdev] DebugFactory
On Sep 22, 2009, at 4:49 PM, Talin wrote:
>
> // Calculate the size of the specified LLVM type.
> Constant * DebugInfoBuilder::getSize(const Type * type) {
> Constant * one = ConstantInt::get(Type::Int32Ty, 1);
> return ConstantExpr::getPtrToInt(
> ConstantExpr::getGetElementPtr(
> ConstantPointerNull::get(PointerType::getUnqual(type)),
>
2011 May 18
0
[LLVMdev] access array problem
Hi Tan Guangming,
> I want to access an array in my instrumentation code. For example:
>
> GlobalVariable:
> int *counter; //counter the number of load/store operations in run-time
> int *counterArray; //record the load/store addresses
strictly speaking these are not arrays, they are pointers. Also, you have
written them in some kind of C-style idiom. What are the declarations
2011 May 18
3
[LLVMdev] access array problem
Hi,
I want to access an array in my instrumentation code. For example:
GlobalVariable:
int *counter; //counter the number of load/store operations in run-time
int *counterArray; //record the load/store addresses
//increase the counter if a load/store is performed
std::vector<Constant *>index(2);
index[0] = Constant::getNullvalue(Type:getInt32Ty(Context));
index[1] =
2004 Dec 21
3
[LLVMdev] Help with code
Hi,
I have this call instruction to printf inserted which is causing
an assertion failure. Any pointers to where I am wrong :
Code Dump :
Function *printFn=M.getNamedFunction(std::string("printf"));
Constant *str=ConstantArray::get("Value : %d\n");
std::vector<Value *> Args(2);
std::vector<Constant *> GEPIndices(2);
2007 May 11
2
[LLVMdev] identifing mallocs with constant sizes
I am writing some code to identify malloc instructions with constant
request sizes and to determine the request size if it is constant. I
have two questions.
1) If a malloc is for an array allocation and the array size is a
ConstantExpr, how can I obtain the value of the ConstantExpr?
2) I am using the following logic to determine if the malloc is for a
constant request size and to
2011 Feb 02
2
[LLVMdev] Convenience methods in ConstantExpr et al
Talin wrote:
> On Mon, Jan 31, 2011 at 10:57 PM, Talin <viridia at gmail.com
> <mailto:viridia at gmail.com>> wrote:
>
> I notice that there's a lot of inconsistency in the various LLVM
> classes with respect to convenience methods. Here's some examples:
>
> For creating GEPS, IRBuilder has:
>
> CreateGEP (2 overloads)
>
2011 May 18
2
[LLVMdev] access array problem
δΊ 2011/5/18 14:29, Duncan Sands ει:
> Hi Tan Guangming,
>
>> I want to access an array in my instrumentation code. For example:
>>
>> GlobalVariable:
>> int *counter; //counter the number of load/store operations in run-time
>> int *counterArray; //record the load/store addresses
> strictly speaking these are not arrays, they are pointers. Also, you have
2012 Jul 04
0
[LLVMdev] Bogus assert in VMCore/Instructions.cpp CallInst::Create?
Andrew Ruef wrote:
> Evening,
>
> I was writing some code that tried to insert calls to the
> llvm.annotation intrinsic function, which has a signature of (i32,
> i8*, i8*, i32). The code is below.
>
> void addAnnotation( BasicBlock *block, Function *F)
> {
> string foo = "foo";
> string bar = "barr";
>
> Type