Displaying 20 results from an estimated 300 matches similar to: "[LLVMdev] Convert a vector size"
2012 May 04
0
[LLVMdev] Convert a vector size
> Is it possible to convert a vectors from different size? For example
> a vector of 3 elements Int16Ty type to vector having one element of
> 64 bit Int64Ty ?
Not with a bitcast. You'd probably use a shuffle followed by a bitcast for that:
%temp = shufflevector <3 x i16> %incoming, <3 x i16> undef, <4 x i32>
<i32 0, i32 1, i32 2, i32 undef>
%out = bitcast
2020 Apr 30
2
Discrepancy between Debug and Release+Asserts versions of Clang/LLVM
I agree that the ArrayRef is likely the issue. I've debugged a crash caused
by a temporary ArrayRef like that a couple times.
Either do what David suggested or use a normal array:
Metadata *mdArray[] = {ConstantInt::get(Int64Ty, 0), newMD};
~Craig
On Thu, Apr 30, 2020 at 9:56 AM David Blaikie via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
>
>
> On Thu, Apr 30, 2020 at
2020 Jan 14
2
sizeof implementation: how to get size as a constantInt?
I'm implementing c style "sizeof()", and I did as
http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
illuarstrated,
and it works find, here's an example of my implementation:
auto *p = builder.CreateGEP(structTy,
llvm::ConstantPointerNull::get(pointerTy),
constint1);
auto *size =
2008 Jul 01
2
[LLVMdev] vmkit on x86_64
Hello,
I'm trying to compile vmkit on a x86_64 linux box with gcc-4.1.2, but
I'm running into troubles because of various problems with casts
between pointers and integers. Is there anybody who succeeded in this
task? Az I see, some of the problems can be fixed with an appropriate
typedef/macro declaration, but in VMCore/JavaObject.cpp some lowlevel
bitmanipulation is used, to mark
2009 Jul 31
2
[LLVMdev] Inserting Instructions (pass)
Hi,
I' am trying to insert an InlineAsm Instruction in my pass, which
FunctionType do I need for Inlineasm?
If I understand it right, I need a call instruction to insert the new
produced InlineAsm?
Thanks for help,
Michael
for (BasicBlock::iterator bi = i->begin(), be = i->end(); bi != be; ++bi){
std::vector<const Type*> asm_arguments;
2008 Jul 01
0
[LLVMdev] vmkit on x86_64
Hi Zsombor,
Thanks for the patch! Unfortunately I can't apply it because the llvm
API has moved from BinaryOperator::create to BinaryOperator::Create. Are
you using svn head?
Now on the x86_64 part. There has been very little work on porting vmkit
on x86_64. If you're having compilation problems, I suppose it's in the
garbage collector directory (GCMmap2). If you could make the
2009 Jul 31
0
[LLVMdev] Inserting Instructions (pass)
On Jul 31, 2009, at 10:24 AM, Michael Graumann wrote:
> Hi,
> I’ am trying to insert an InlineAsm Instruction in my pass, which
> FunctionType do I need for Inlineasm?
> If I understand it right, I need a call instruction to insert the
> new produced InlineAsm?
>
> Thanks for help
Inline asm works like a "callee". So for:
call void asm sideeffect
2011 Jan 24
2
[LLVMdev] How to create an IntegerType of the native word size
Hi all,
I couldn't find any reasonable way to create the IntegerType that would
match, say, intptr_t, that is the native word size of the machine I'm
building on. More accurately defined, when compiling on a 64 bit Mac OS
machine I want it to be Int64Ty, but if for example I'm using the "-arch
i386" command line option on that machine during compilation, I want it to
be
2020 Apr 30
2
Discrepancy between Debug and Release+Asserts versions of Clang/LLVM
Hello,
I am editing the LowerTypeTests pass in LLVM, and part of my additions
include the following 3 lines of code:
// newTypeName is a std::string
MDString* newMD = MDString::get(M.getContext(), newTypeName);
ArrayRef<Metadata*> mdArray {ConstantInt::get(Int64Ty, 0), newMD};
auto* node = MDTuple::get(M.getContext(), mdArray);
Thus far, I have been developing on a version of Clang with
2015 Mar 12
2
[LLVMdev] Passing a function pointer as parameter to function call?
Dear all,
I'm writing an LLVM pass, and I want to insert a call instruction that
takes a function pointer as a parameter. The effect would be the same as
following:
atexit(foo);
Where foo is a function I insert with M.getOrInsertFunction(), which in
LLVM is a Function class.
I searched for a while and did not come up with a satisfying answer. Should
I create a Value class of pointer type,
2009 Sep 18
3
[LLVMdev] compiling java frontend
Thanks, I am now working on compiling up VMKit. When compiling VMKit in my
up-to-date svn checkout I get several error messages on missing members of
the class 'llvm::Type':
PNetLib.cpp: In function ‘void decapsulePrimitive(n3::VMObject*, const
llvm::Type*, std::vector<llvm::GenericValue,
std::allocator<llvm::GenericValue> >&)’:
PNetLib.cpp:694: error: ‘Int1Ty’ is not a
2007 Feb 27
2
[LLVMdev] another problem with function arguments aligment
I think, we must move function arguments lowering from frontend to
LLVM core. This lowering is generating machine dependent bytecode. See
http://llvm.org/bugs/show_bug.cgi?id=1230
Lauro
2007/2/26, Chris Lattner <sabre at nondot.org>:
> On Mon, 26 Feb 2007, Lauro Ramos Venancio wrote:
> > The problem is: llvm-gcc generates the same bytecode for both functions:
> >
> >
2007 Feb 26
0
[LLVMdev] another problem with function arguments aligment
On Mon, 26 Feb 2007, Lauro Ramos Venancio wrote:
> The problem is: llvm-gcc generates the same bytecode for both functions:
>
> declare void @f(i32, i64)
> declare void @g(i32, i64)
>
> I can't differ an i64 argument from a struct argument.
Oops. You can fix this by changing llvm-gcc: gcc/llvm-abi.h
Grep for instances of Int64Ty there. I can help answer any q's you
2009 Mar 08
2
[LLVMdev] Creating Pointer Constants
Hello,
I am writing a JIT compiler for a subset of the Matlab language and as a
part of my implementation, I would like to be able to pass a constant
pointer to a native function I'm calling.
Right now, this is what I do:
llvm::Constant* constInt = llvm::ConstantInt::get(llvm::Type::Int64Ty,
(int64)thePointer);
llvm::Value* constPtr = llvm::ConstantExpr::getIntToPtr(constInt,
2009 Sep 18
0
[LLVMdev] compiling java frontend
Hi Andreas,
Since you're only looking for a Java frontend, I suggest you only build
the Java frontend of vmkit and don't pass any pnet or mono information
to the configure script. I haven't updated the pnet part of the .Net
frontend. On the other hand, the Java frontend is up-to-date.
Nicolas
Andreas Saebjoernsen wrote:
> Thanks, I am now working on compiling up VMKit. When
2013 Oct 07
1
[LLVMdev] Typecasting int32ty to int64ty
I have something like this on my code :-
vector<Value*> args3;
args3.push_back(instr->getOperand(0)); //where 'instr' is store instruction
Now when I check the Type of instr->getOperand(0).
It varies to i32 and i64, depending on the operand(0) of instruction.
Due to which my vector<Value*> has different Type of Value*.
How can I convert i32 to i64 type before pushing
2012 Feb 29
1
[LLVMdev] Restrictions on bitcast of arbitrary vector types?
Hi,
The LLVM lang ref (http://llvm.org/docs/LangRef.html#i_bitcast) notes
that bitcast of vectors to vectors is OK, provided the vectors are of
the same size. In attempting this on large vector types (e.g. 16xi64 ->
16xf64), I get assertions related to Extended Value Types when
attempting to perform code generation, but no errors at the BC level. Is
it simply unsupported to stray outwith
2009 Aug 01
2
[LLVMdev] Inserting Instructions (pass)
Thank you Chris,
for your hint, but I am still too stupid. I tried two versions
asm_arguments.push_back(Type::VoidTy);
FunctionType *asm_type = FunctionType::get(Type::VoidTy, asm_arguments,
false);
Alternatively
FunctionType *asm_type = FunctionType::get(Type::VoidTy, std::vector<const
Type*>(), false);
. Can you give me a snippet of example code, or somebody else?
2007 Feb 26
3
[LLVMdev] another problem with function arguments aligment
The ARM EABI (AAPCS) defines:
- i64 values are 8-bytes aligned
- "The alignment of an aggregate shall be the alignment of its
most-aligned component."
So,
struct ss {
int x;
int y;
};
void f(int a, struct ss b);
r0 <- a
r1-r2 <- b
void g(int a, long long b);
r0 <- a
r2-r3 <- b
The problem is: llvm-gcc generates the same bytecode for both functions:
declare void
2010 Jun 05
0
[LLVMdev] Fwd: Passing structures by value on Windows
---------- Forwarded message ----------
From: lost <lostfreeman at gmail.com>
Date: 2010/6/5
Subject: Re: [LLVMdev] Passing structures by value on Windows
To: Anton Korobeynikov <anton at korobeynikov.info>
Ok, but how to bitcast structure?
Documentation<http://llvm.org/docs/LangRef.html#i_bitcast>says that
bitcast does not applicable to aggregate values.
2010/6/3 Anton