Displaying 20 results from an estimated 6000 matches similar to: "[LLVMdev] inserting a target specific builtin in llvm pass"
2011 Jul 26
4
[LLVMdev] How to get the return address on the stack on LLVM
Hi all,
I want to implement the Xor random canary, so I have to get the return
address in the prologue and epilogue of the function.
In the prologue of the function, before I insert into the canary on
the stack, I can get the return address by:
ConstantInt* ci =
llvm::ConstantInt::get(Type::getInt32Ty(RI->getContext()), 0);
Value* Args1[] = {ci};
CallInst* callInst =
2009 Jun 24
3
[LLVMdev] Replacing instruction in LLVM IR by an intrinsics
Hi everyone,
I am trying to write a pass, that finds some instructions and replaces them with my intrinsics,
but I am having problem understanding, how this should be done.
Let's say I have this instruction:
%tmp14 = load i32* getelementptr ([32 x i32]* @gpregs, i32 0, i64 28)
and i need to read the load's operands and replace it by let's say:
%tmp14 = call i32
2015 Apr 18
2
[LLVMdev] how can I create an SSE instrinsics sqrt?
I want to create a vector version sqrt as the following.
Value *Approx::CreateFSqrt(IRBuilder<> &builder, Value *v, const char*
Name) {
Type *tys[] = {v->getType()};
Module* M = currF->getParent();
Value* sqrtv = Intrinsic::getDeclaration(M, Intrinsic::x86_sse2_sqrt_pd);
CallInst *CI = builder.CreateCall(sqrtv, v, Name);
return CI;
}
Here is Value *v is <2 x
2009 Jun 25
0
[LLVMdev] Replacing instruction in LLVM IR by an intrinsics
On Thu, Jun 25, 2009 at 12:32 AM, ihusar<ihusar at fit.vutbr.cz> wrote:
> //now i need to create an instruction that represents a call to a intrinsic
> Function* FIntr = Intrinsic::getDeclaration(&M, Intrinsic::regread_i32);
>
> // here it fails: void llvm::CallInst::init(llvm::Value*):
> //Assertion
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 =
2008 Feb 20
1
[LLVMdev] Invalid intrinsic name error
Hi,
Thank You for the advice and we were able to solve
that problem by the following modifications to the
Instrinsics.td file.
But I now have an "Invalid Intrinsic name" error
This error occurs presumably because the created
intrinsic is named:
llvm.migrate_begin.i32
Intrinsics.gen checks for a string length of 18
(i.e. the length without the .i32).
Kindly help me through it.
2008 Feb 19
2
[LLVMdev] Problem with variable argument intrinsics
Hi,
I tried creating variable argument intrinsics which
are to be placeholders for some instructions which
should not be executed by the backend.
Kindly help me with the errors in my "migrate_begin"
intrinsic creation
//Additions made to Intrinsics.td file:
def llvm_migrate_begin : LLVMType<iAny>;
def int_migrate_begin :
2015 Apr 18
2
[LLVMdev] how can I create an SSE instrinsics sqrt?
Thanks, Shahid. It is fixed now.
On Fri, Apr 17, 2015 at 8:50 PM, Shahid, Asghar-ahmad <
Asghar-ahmad.Shahid at amd.com> wrote:
> Hi zhi,
>
>
>
> You have to also pass the value type to getDecalaration() API such as
>
>
>
> Value* sqrtv = Intrinsic::getDeclaration(M, Intrinsic::x86_sse2_sqrt_pd,
> v->getType());
>
>
>
> Regards,
>
>
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
2008 Feb 19
0
[LLVMdev] Problem with variable argument intrinsics
On Feb 19, 2008, at 1:11 AM, aditya vishnubhotla wrote:
> Hi,
> I tried creating variable argument intrinsics which
> are to be placeholders for some instructions which
> should not be executed by the backend.
>
> Kindly help me with the errors in my "migrate_begin"
> intrinsic creation
>
> //Additions made to Intrinsics.td file:
>
> def
2015 May 19
2
[LLVMdev] Module crash when adding CallInst
Hi,
I am learning to write LLVM modules. I am using IRBuilder to insert calls
to an existing function. The call is to be inserted at a random location in
every function in the code. The call does get inserted, however, the module
crashes later (after doFinalization()). The crash happens only sometimes,
not always.
These are the kind of instructions that I see in the generated code.
%callins =
2007 Apr 20
2
[LLVMdev] llvm-gcc Bug, Looking for Advice on Fix
Ok, I've tracked down the problem I've had bootstrapping
llvm-gcc. The culprit is in TreeToLLVM::EmitMemCpy:
void TreeToLLVM::EmitMemCpy(Value *DestPtr, Value *SrcPtr, Value *Size,
unsigned Align) {
const Type *SBP = PointerType::get(Type::Int8Ty);
const Type *IntPtr = TD.getIntPtrType();
Value *Ops[4] = {
CastToType(Instruction::BitCast,
2007 Mar 07
3
[LLVMdev] use of CallInst()
To create a new CallInst I used to call the following constructor:
CallInst(Value *F, const std::vector<Value*> &Par, const std::string
&Name = "", Instruction *InsertBefore = 0);
However, it seems as though that constructor has been removed. I assume
that I'm suppossed to use the following constructor, but I can't figure
out what to pass as the Args parameter
2014 Jan 08
3
[LLVMdev] reference to non-static member function must be called
Hi,everyone.
I'm writing a pass in which a CallInst to an external function will be
inserted. The function is declared like this:
void func(int a, unsigned chat *p);
and in the Pass(a Function Pass ,and using the InstVistor template ), I
wrote like this:
void visitStoreInst(StoreInst &SI)
{
//Get the refference of the types
Module *M =
2016 Jun 13
2
LLVM IR intrinsics placeholder for strings [was Re: Back end with special loop instructions (using LLVM IR intrinsics)]
Hello.
I come back to this thread. But I want to ask a slightly different question.
Is there a way to have LLVM IR language intrinsics that are given at construction
time a string that is written at assembly generation time as it is? (so, basically having
placeholders of strings in LLVM that remain untouched until the end, including code
generation time.)
More exactly, I would
2008 Apr 27
1
[LLVMdev] Can't invoke an intrinsic?
In line 1157 of Verifier.cpp, there is this code:
Assert1(!F->isIntrinsic() || (i == 0 && isa<CallInst>(I)),
"Cannot take the address of an intrinsic!", &I);
This check appears to have a problem with this line:
invoke void @llvm.memcpy.i32( i8* %._items.i.i, i8*
%._items2.i.i, i32 ptrtoint (i32* getelementptr ([0 x i32]* null, i32 0,
2012 Apr 07
1
[LLVMdev] How to insert a self-written function to a piece of programme
Hi all,
I wrote a function pass. In the pass, it ran through all the instruction that call to functions. When arriving at the exact function that I m interested in, it would insert a self-made function.
Now I've finished the pass, the compilation is successful. The pass can find the function I like and can insert the CallInst to call my check function. BUT, when running the
2013 Jan 24
2
[LLVMdev] FunctionPass question
Hi,
I am working on a pass to convert lib calls to intrinsic calls as discussed here: http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-January/058507.html
In my first attempt I created a FunctionPass that uses CallInst::setCalledFunction to replace the callee with the appropriate intrinsic (using Intrinsic::getDeclaration).
After the pass runs I get an assertion from CallGraphSCCPass:
2007 Mar 07
0
[LLVMdev] use of CallInst()
On Tue, 2007-03-06 at 22:44 -0600, Ryan M. Lefever wrote:
> To create a new CallInst I used to call the following constructor:
>
> CallInst(Value *F, const std::vector<Value*> &Par, const std::string
> &Name = "", Instruction *InsertBefore = 0);
>
> However, it seems as though that constructor has been removed. I assume
> that I'm suppossed to
2009 Mar 06
3
[LLVMdev] Inserting annotations
Hello together,
how can i insert annotations in IR ?
I want actually write something like:
CallInst *call = CallInst::Create( ??? , aBasicBlock);
in my pass.
Regards
Raad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090305/cd1db761/attachment.html>