search for: createbitcast

Displaying 20 results from an estimated 21 matches for "createbitcast".

2018 May 30
1
llvm.annotation arguments
Hello all, According to *clang/lib/CodeGen/CodeGenFunction.cpp*, a LLVM annotation intrinsic call has 4 arguments: - llvm::Value *AnnotatedVal, - Builder.CreateBitCast(CGM.EmitAnnotationString(AnnotationStr), Int8PtrTy), - Builder.CreateBitCast(CGM.EmitAnnotationUnit(Location), Int8PtrTy), - CGM.EmitAnnotationLineNo(Location) However, this is what an annotation intrinsic *char __attribute__((annotate("DIFF"))) diff* looks like in the IR: @.str = priva...
2014 Feb 21
12
[LLVMdev] asan coverage
...t;__llvm_pgo_name"); MangledName = llvm::ConstantExpr::getBitCast(MangledName, Int8PtrTy); - PGOBuilder.CreateCall3(EmitFunc, MangledName, + PGOBuilder.CreateCall4(EmitFunc, MangledName, PGOBuilder.getInt32(NumRegionCounters), - PGOBuilder.CreateBitCast(RegionCounters, Int64PtrTy)); + PGOBuilder.CreateBitCast(RegionCounters, Int64PtrTy), + PGOBuilder.CreateBitCast(RegionPCs, Int64PtrTy)); } llvm::Function *CodeGenPGO::emitInitialization(CodeGenModule &CGM) { @@ -769,6 +771,13 @@...
2012 Nov 28
0
[LLVMdev] [llvm-commits] [dragonegg] r168787 - in /dragonegg/trunk: src/x86/Target.cpp src/x86/x86_builtins test/validator/c/copysignp.c
...Type *IntEltTy = IntegerType::get(Context, EltBitWidth); > + Type *IntVecTy = VectorType::get(IntEltTy, VecTy->getNumElements()); > + APInt SignBit = APInt::getSignBit(EltBitWidth); > + Constant *SignMask = ConstantInt::get(IntVecTy, SignBit); > + Value *IntLHS = Builder.CreateBitCast(Ops[0], IntVecTy); > + Value *IntRHS = Builder.CreateBitCast(Ops[1], IntVecTy); > + Value *Sign = Builder.CreateAnd(IntRHS, SignMask); > + Value *Abs = Builder.CreateAnd(IntLHS, ConstantExpr::getNot(SignMask)); > + Value *IntRes = Builder.CreateOr(Abs, Sign); > + Resul...
2015 Jan 05
3
[LLVMdev] should AlwaysInliner inline this case?
...ransform this parameter value. if (AttrBuilder(CallerPAL.getParamAttributes(i + 1), i + 1). @@ -1551,7 +1551,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { if ((*AI)->getType() == ParamTy) { Args.push_back(*AI); } else { - Args.push_back(Builder->CreateBitCast(*AI, ParamTy)); + Args.push_back(Builder->CreateBitOrPointerCast(*AI, ParamTy)); } // Add any parameter attributes. Running opt -instcombine -inline -instcombine with this patch results in: define i32 @g(i32* %a) { entry: %0 = ptrtoint i32* %a to i64 %call = tail call i32 @f...
2011 Mar 17
0
[LLVMdev] Operating on contents of virtual registers
...rns an > llvm::Instruction (that refers to the definition of the operand). What I am > trying to find out is how to get the value of the operand. When you refer to > bitcasting to i8*, do you mean casting the return value from getOperand() > itself? > Ashay I mean calling IRBuilder::CreateBitCast with the return value from getOperand(). -Eli > On Wed, Mar 16, 2011 at 11:03 PM, Eli Friedman <eli.friedman at gmail.com> > wrote: >> >> On Wed, Mar 16, 2011 at 6:00 PM, Ashay Rane <ashay.rane at asu.edu> wrote: >> > Hello, >> > I was facing some d...
2014 Feb 19
2
[LLVMdev] asan coverage
I've built chromium with " -fprofile-instr-generate -fsanitize=address" -- the performance looks good! The file format from r198638 is indeed rudimentary. Do you already know how the real output format will look like? Just to summarize what I think is important: - minimal size on disk, minimal amount of files - minimal i/o while writing to disk, no lockf or some such -
2017 Oct 14
2
Bug in replaceUsesOfWith: does not keep addrspace consistent in GEP
...Slot->replaceUsesOfWith(Arg, Arg2); errs() << "Slot(replaced): " << *Slot << "\n"; } else { Slot = cast<Instruction>(Builder.CreateGEP(Arg2, {Builder.getInt64(1)}, "slot")); } * Value *TypedSlot = Builder.CreateBitCast(Slot, PointerType::get(Builder.getInt64Ty(), 1), "slot_typed"); Value *Load = Builder.CreateLoad(TypedSlot, "Val"); Builder.CreateRet(Load); if (verifyModule(*m) == 1) { errs() << "module has an error: "; verifyModule(*m, &errs())...
2011 Mar 17
1
[LLVMdev] Operating on contents of virtual registers
...ers to the definition of the operand). What I > am > > trying to find out is how to get the value of the operand. When you refer > to > > bitcasting to i8*, do you mean casting the return value from getOperand() > > itself? > > Ashay > > I mean calling IRBuilder::CreateBitCast with the return value from > getOperand(). > > -Eli > > > On Wed, Mar 16, 2011 at 11:03 PM, Eli Friedman <eli.friedman at gmail.com> > > wrote: > >> > >> On Wed, Mar 16, 2011 at 6:00 PM, Ashay Rane <ashay.rane at asu.edu> wrote: > >> &g...
2011 Mar 17
2
[LLVMdev] Operating on contents of virtual registers
Hi Eli, Thanks for the reply. The problem is that getOperand() returns an llvm::Instruction (that refers to the definition of the operand). What I am trying to find out is how to get the value of the operand. When you refer to bitcasting to i8*, do you mean casting the return value from getOperand() itself? Ashay On Wed, Mar 16, 2011 at 11:03 PM, Eli Friedman <eli.friedman at
2017 Jun 10
2
Instruction does not dominate all uses!
...4 0, i64 0 %1 = load i32, i32* %arrayidx, align 4 ret i32 %1 } ===================================================== if (AllocaInst *alloca_inst = dyn_cast<AllocaInst>(&I)) { . . . Value* var_addr = builder.CreateBitCast(alloca_inst, Type::getInt8PtrTy(Ctx)); . . . } ===================================================== I am receiving the following error: Instruction does not dominate all uses! %var = alloca [3 x i32], align 4 %0 = bit...
2011 Mar 17
0
[LLVMdev] Operating on contents of virtual registers
...gt; am >> > trying to find out is how to get the value of the operand. When you >> > refer to >> > bitcasting to i8*, do you mean casting the return value from >> > getOperand() >> > itself? >> > Ashay >> >> I mean calling IRBuilder::CreateBitCast with the return value from >> getOperand(). >> >> -Eli >> >> > On Wed, Mar 16, 2011 at 11:03 PM, Eli Friedman <eli.friedman at gmail.com> >> > wrote: >> >> >> >> On Wed, Mar 16, 2011 at 6:00 PM, Ashay Rane <ashay.rane at asu...
2010 Feb 27
3
[LLVMdev] Object layout bug for C++ derived class with long long integer
I have a simple C++ class that looks like this: struct Foo { Thing *first; Blob *second; unsigned long third; }; Then I have a derived C++ class that look like this: struct Bar : Foo { long long fourth; } I generate JIT code to access 'fourth' from a Foo * as follows: BarPtr = CreateBitCast(FooPtr, BarPtrTy); FourthPtr = CreateConstGEP2_32(BarPtr, 0, 3); FourthValue = CreateLoad(FourthPtr); ConstantValue = ConstantInt::get(FourthValue->getType(), 0x2A4); ComparisonValue = CreateICmpEQ(FourthValue, ConstantValue); This appears to work on Linux and MacOSX with LLVM 2.6 and LLVM...
2020 May 07
2
Cast between struct
> On May 6, 2020, at 21:53, Krzysztof Parzyszek <kparzysz at quicinc.com> wrote: > > You can > 1. extract individual elements of {i8*, i64}, > 2. bitcast the first to some_struct*, > 3. insert them into a new struct of type {some_struct*, i64}. Thanks for the help. I’m thinking the same way. Now I’m stuck with how to create a struct; I know how to create a
2012 Apr 05
0
[LLVMdev] Catching C++ exceptions, cleaning up, rethrowing
...t;Value*> &ctor_args, > Function *dtor ) { > > // Allocate object's storage and insert 'this' ptr into ctor args. > AllocaInst *const obj_ptr = createEntryBlockAlloca( fn, obj_name, obj_type ); > Value *const void_obj_ptr = builder.CreateBitCast( obj_ptr, void_ptr_type ); > ctor_args.insert( ctor_args.begin(), void_obj_ptr ); > > // Call object's constructor. > BasicBlock *const normal_blk = BasicBlock::Create( ctx, "normal", fn ); > BasicBlock *const unwind_blk = BasicBlock::Create( ctx, "unwin...
2017 Apr 28
3
How to get the address of a global variable in LLVM?
On 28 April 2017 at 14:32, Jonathan Roelofs via llvm-dev <llvm-dev at lists.llvm.org> wrote: > You need a load instruction since your function takes an i32, not an > i32*.... A global's value in llvm is its address, not the numeric data it > contains. I suspect he actually wants to make his function take an "i8*" and bitcast his pointer to that type before calling it.
2012 Mar 23
2
[LLVMdev] Catching C++ exceptions, cleaning up, rethrowing
On Mar 23, 2012, at 4:29 PM, Paul J. Lucas wrote: > On Mar 23, 2012, at 3:25 PM, Bill Wendling wrote: > >> Let's take your example. You will have code that looks like this: >> >> extern "C" void thunk_item_M_delete( void *v_that ) { >> item *that = 0; >> try { >> that = static_cast<item*>( v_that ); >>
2007 Dec 17
0
[LLVMdev] Elsa and LLVM and LLVM submissions
...+ return CreateCast(Instruction::PtrToInt, V, DestTy, Name); > + } > + Value *CreateIntToPtr(Value *V, const Type *DestTy, > + const char *Name = "") { > + return CreateCast(Instruction::IntToPtr, V, DestTy, Name); > + } > + Value *CreateBitCast(Value *V, const Type *DestTy, > + const char *Name = "") { > + return CreateCast(Instruction::BitCast, V, DestTy, Name); > + } > + > + Value *CreateCast(Instruction::CastOps Op, Value *V, const Type > *DestTy, > +...
2007 Dec 17
2
[LLVMdev] Elsa and LLVM and LLVM submissions
Devang Patel wrote: > On Dec 15, 2007, at 12:15 PM, Richard Pennington wrote: > >> I got the current version of LLVM via svn yesterday and modified my >> code to >> use the LLVMFoldingBuilder. Very nice! >> >> My question is this: I noticed that the folding builder doesn't fold >> some >> operations, e.g. casts. Is there some reason why? If
2015 Jan 05
3
[LLVMdev] should AlwaysInliner inline this case?
Philip, I post here because I think AlwaysInliner should inline it. I want to detect the indirect calls for Inliner, and I want to hear inputs. let me define indirect call first in my idea. In one single expression, one function may be subject to bitcast more than one time. we can detect this situation and treat it as a regular call of last function, is that okay? thanks, --lx On Mon, Jan 5,
2020 May 06
2
Unexpected behavior found in Stack Coloring pass, need clarification
Hello, I have come across an unusual behavior where instruction domination rule is violated "Instruction does not dominate all its uses." It concerns with StackColoring pass present at llvm/lib/CodeGen/StackColoring.cpp. I am reaching out to the LLVM community to help me understand the cause of this issue and the working of the pass. The IR produced at the end of the pass seems to be