Displaying 20 results from an estimated 4000 matches similar to: "[LLVMdev] identifing mallocs with constant sizes"
2007 May 11
0
[LLVMdev] identifing mallocs with constant sizes
Ryan M. Lefever wrote:
> 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?
>
The only way I know of is to determine what type
2012 Jan 20
2
[LLVMdev] How to force the creation of arrays with zeroes?
> you can't, you can only get a ConstantAggregateZero. This is actually kind of
> annoying, and means that places expecting a ConstantArray have to remember to
> also check for ConstantAggregateZero. Perhaps there's a good reason for the
> current design, but if not it would be great to eliminate this wart.
Well, I think the main reason it so reduce the size of .ll / .bc when
2012 Jan 20
0
[LLVMdev] How to force the creation of arrays with zeroes?
Hi Anton,
>> you can't, you can only get a ConstantAggregateZero. This is actually kind of
>> annoying, and means that places expecting a ConstantArray have to remember to
>> also check for ConstantAggregateZero. Perhaps there's a good reason for the
>> current design, but if not it would be great to eliminate this wart.
> Well, I think the main reason it so
2012 Jan 20
2
[LLVMdev] How to force the creation of arrays with zeroes?
Hi all. I propose to use wrapper for this kind of constant objects.
Consider next code:
Constant* C = reinterpret_cast<Constant*>(I->getOperand(idx));
Constant* ArrayItem;
if (!isa<ConstantAggregateZero>(C))
ArrayItem = reinterpret_cast<Constant*>(I->getOperand(ArrItemIdx));
else
ArrayItem = ZeroInt;
Code analog within wrapper:
ConstOrZero
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.
--------------
2016 Sep 24
2
RFC: ConstantData should not have use-lists
> On 2016-Sep-24, at 15:16, Mehdi Amini <mehdi.amini at apple.com> wrote:
>
>>
>> On Sep 24, 2016, at 3:06 PM, Duncan P. N. Exon Smith via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>>
>> r261464 added a type called ConstantData to the Value hierarchy. This
>> is a parent type for constants with no operands, such as i32 0 and null.
>>
2016 Sep 24
4
RFC: ConstantData should not have use-lists
r261464 added a type called ConstantData to the Value hierarchy. This
is a parent type for constants with no operands, such as i32 0 and null.
Since then, I've removed most instances of iterating through the
use-lists of an instance of ConstantData. I'd like to make this
illegal. Since the users of ConstantData are spread across an
LLVMContext, most code that looks at the users is
2011 Feb 01
2
[LLVMdev] Convenience methods in ConstantExpr et al
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)
CreateInBoundsGEP (2 overloads)
CreateConstGEP1_32
CreateConstInBoundsGEP1_32
CreateConstGEP2_32
CreateConstInBoundsGEP2_32
CreateConstGEP1_64
CreateConstInBoundsGEP1_64
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)
>
2012 Sep 04
2
[LLVMdev] [NVPTX] Backend cannot handle array-of-arrays constant
I think our test case demonstrates that requiring the array item being
initialized to be constant is incorrect. NVPTX does not crash anymore
and produces correct result with the following change:
--- NVPTXAsmPrinter.cpp 2012-09-03 15:14:00.000000000 +0200
+++ NVPTXAsmPrinter.cpp 2012-09-04 15:47:17.859398193 +0200
@@ -1890,17 +1890,15 @@
case Type::ArrayTyID:
case Type::VectorTyID:
case
2011 Feb 02
0
[LLVMdev] Convenience methods in ConstantExpr et al
On Mon, Jan 31, 2011 at 10:57 PM, Talin <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)
> CreateInBoundsGEP (2 overloads)
> CreateConstGEP1_32
>
2015 Jan 20
2
[LLVMdev] Bug in InsertElement constant propagation?
Does anybody else have an opinion on this issue? I'm planning to submit a patch which would add a new get method for ConstantDataVector taking an ArrayRef<Constant*> and use that in the few places in constant propagation where convertToFloat is used.
Let me know if you think there is a more obvious way to do it.
Right now the only way to create a ConstantDataVector are those method:
2013 Jun 25
4
[LLVMdev] get value
Hi Cristianno,
Thank you, it works :)
with an extra cast:
Value *v ......
ConstantInt* RR = (ConstantInt *)v;
uint64_t VV = (RR->getValue()).getLimitedValue();
errs()<<"\nRR "<<VV<<"\n";
2015 Jan 15
2
[LLVMdev] Handling of undef in the IR
Hi all,
I have a very simple test case (thanks to bugpoint) that hit an assert in reassociate.
(the assert is (C->getType()->isIntOrIntVectorTy() && "Cannot NEG a nonintegral value!"), function getNeg)
The function is taking a Constant as argument, but the assert does not expect an undef. I’m not sure whose responsibility is it to handle that (caller?).
Do we have to
2020 Sep 30
2
Creating a global variable for a struct array
Let me clarify my question.
I have a struct array h1 as follows:
dhash h1[10];
I want to get a Constant* to variable h1. It looks like I can use ConstantStruct::get(StructType*, ArrayRef<Constant *>) to do this.
My question is how to get the second argument of type ArrayRef<Constant *> from the above variable h1.
Thanks,
Chaitra
________________________________
From: Tim Northover
2012 Jan 21
0
[LLVMdev] How to force the creation of arrays with zeroes?
I'd really rather not do this. Faking that large zero filled array is represented with ConstantArray means that the compiler will inevitably end up calling getOperand on each of those elements, burning a ton of compile time.
-Chris
On Jan 20, 2012, at 12:16 PM, Stepan Dyatkovskiy <STPWORLD at narod.ru> wrote:
> Hi all. I propose to use wrapper for this kind of constant objects.
2014 Sep 19
2
[LLVMdev] More careful treatment of floating point exceptions
Hi Sanjay,
Thanks, I saw this flag and it's definitely should be considered, but
it appeared to me to be static characteristic of target platform. I'm
not sure how appropriate it would be to change its value from a front-end.
It says "Has", while optional flag would rather say "Uses" meaning that
implementation cares about floating point exceptions.
Regards,
Sergey
2012 Sep 06
0
[LLVMdev] [NVPTX] Backend cannot handle array-of-arrays constant
On 09/04/2012 09:57 AM, Dmitry N. Mikushin wrote:
> I think our test case demonstrates that requiring the array item being
> initialized to be constant is incorrect. NVPTX does not crash anymore
> and produces correct result with the following change:
>
> --- NVPTXAsmPrinter.cpp 2012-09-03 15:14:00.000000000 +0200
> +++ NVPTXAsmPrinter.cpp 2012-09-04 15:47:17.859398193 +0200
>
2017 Jun 12
2
How to know the sub-class of a Value class?
On 11 June 2017 at 23:03, Craig Topper <craig.topper at gmail.com> wrote:
> Try value->dump() assuming you're using a debug build.
>
>
The information displayed is non-uniform. There are two different cases
based on my sample program:
(1) dump() shows the Type and *some* value which I don't
understand what it is
(2) dump() shows the instruction that
2013 Jun 25
2
[LLVMdev] get value
Hello !
This may be a trivial question, but I cannot get fields from a Value type.
If my Value is i32 1, how can I store 1 in a different structure (an integer) ? For the type, I have getType(). For the value, I see no method in Value.h.
I tried to cast to ConstantExpr and then to get operands, or cast to ConstantDataArray and then use getAsString(), but is not working. How should I get the