search for: createintcast

Displaying 5 results from an estimated 5 matches for "createintcast".

Did you mean: createbitcast
2007 Dec 17
0
[LLVMdev] Elsa and LLVM and LLVM submissions
...*V, const Type > *DestTy, > + const char *Name = "") { > + if (Constant *VC = dyn_cast<Constant>(V)) > + return ConstantExpr::getCast(Op, VC, DestTy); > + return LLVMBuilder::CreateCast(Op, V, DestTy, Name); > + } > + Value *CreateIntCast(Value *V, const Type *DestTy, bool isSigned, > + const char *Name = "") { > + if (Constant *VC = dyn_cast<Constant>(V)) > + return ConstantExpr::getIntegerCast(VC, DestTy, isSigned); > + return LLVMBuilder::CreateIntCast(V, DestTy, isS...
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
2011 Aug 19
3
[LLVMdev] Why int variable get promoted to i64
Hi, all I found in some cases the int variable get promoted to i64, although I think it should i32. I use the online demo (http://llvm.org/demo). And below is the test case. ------------- test case ------------- int test(int x[], int y[], int n) { int i = 0; int sum = 0; for ( ; i < n; i++) { sum += x[i] * y[i]; } return sum; } ------------------------------------- No
2014 Mar 07
3
[LLVMdev] [RFC] Add second "failure" AtomicOrdering to cmpxchg instruction
...fed7508..6ad5b6f 100644 --- a/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ b/lib/Transforms/Instrumentation/ThreadSanitizer.cpp @@ -556,8 +556,8 @@ bool ThreadSanitizer::instrumentAtomic(Instruction *I) { Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy), IRB.CreateIntCast(CASI->getCompareOperand(), Ty, false), IRB.CreateIntCast(CASI->getNewValOperand(), Ty, false), - createOrdering(&IRB, CASI->getOrdering()), - createFailOrdering(&IRB, CASI->getOrdering())}; + creat...
2014 Nov 03
8
[LLVMdev] [PATCH] Protection against stack-based memory corruption errors using SafeStack
...+ Ie = DynamicAlloca.end(); It != Ie; ++It) { + AllocaInst *AI = *It; + IRB.SetInsertPoint(AI); + + // Compute the new SP value (after AI) + Value *ArraySize = AI->getArraySize(); + if (ArraySize->getType() != IntPtrTy) + ArraySize = IRB.CreateIntCast(ArraySize, IntPtrTy, false); + + Type *Ty = AI->getAllocatedType(); + uint64_t TySize = DL->getTypeAllocSize(Ty); + Value *Size = IRB.CreateMul(ArraySize, ConstantInt::get(IntPtrTy, TySize)); + + Value *SP = IRB.CreatePtrToInt(IRB.CreateLoad(UnsafeStackPtr), IntPtrTy); + SP = I...