search for: intptrty

Displaying 19 results from an estimated 19 matches for "intptrty".

Did you mean: int8ptrty
2015 Nov 12
4
Fwd: asan for allocas on powerpc64
...ll __asan_allocas_unpoison(uptr top, uptr bottom); // NB "top" here means lowest address and "bottom" means highest! IRB.CreateCall( AsanAllocasUnpoisonFunc, { IRB.CreateLoad(DynamicAllocaLayout), IRB.CreatePointerToInt(SaveRestoreInst->getOperand(0), IntptrTy) } ); I think the problem is that the operand to stackrestore is the new native sp register value to restore, and this code is assuming that that will be a higher address than all the allocas that are being unallocated. But on PowerPC64, the native sp is always lower than the address of the...
2005 May 13
0
[LLVMdev] LongTy in LowerInvoke.cpp
...kes issue with this, it would be best to tell the CBE to emit casts to C >> (long) or something. > > Actually that's the only case I stumbled over this problem in a somewhat > larger C++ program, and it's clearly the wrong type in LowerInvoke.cpp - it > really should be IntPtrTy. But maybe we could use just IntTy here to avoid > target dependencies. Note that this is perfectly legal llvm code and the CBE should work on it. The reason this doesn't show up often is because the instcombine pass shrinks longs to ints on 32-bit targets. This is a property of the op...
2016 Aug 25
2
InstList insert depreciated?
...is done, I insert my new instruction in the instruction container list using InstList.insert(). // code void FSliceModulePass::allocaVSetArray(void) { auto &B = F->getEntryBlock(); auto &IList = B.getInstList(); auto &FirstI = *IList.begin(); auto TaintVar = new AllocaInst(IntPtrTy, FirstI); IList.insert(FirstI, TaintVar); // ERROR After migrating to 3.8.1, It gives me the following error: ERROR: /home/shehbaz/project/plugin/FSlice.cpp: In member function ‘void FSliceModulePass::allocaVSetArray()’: /home/shehbaz/project/plugin/FSlice.cpp:284:34: error: no matching fun...
2016 Aug 25
2
InstList insert depreciated?
...e >> first instruction of the basic block, and then calling insertAfter() >> on it as follows: >> >> auto &B = F->getEntryBlock(); >> auto &IList = B.getInstList(); >> auto &FirstI = *IList.begin(); >> auto TaintVar = new AllocaInst(IntPtrTy); >> // IList.insert(FirstI, TaintVar); // OLD >> FirstI.insertAfter(TaintVar); // NEW > > > You want: > > TaintVar->insertAfter(FirstI); > > > Jon > > -- > Jon Roelofs > jonathan at codesourcery.com > CodeSourcery / Mentor Embedded...
2015 Nov 17
3
asan for allocas on powerpc64
...gt; // NB "top" here means lowest address and "bottom" means highest! > > IRB.CreateCall( > AsanAllocasUnpoisonFunc, > { > IRB.CreateLoad(DynamicAllocaLayout), > IRB.CreatePointerToInt(SaveRestoreInst->getOperand(0), IntptrTy) > } > ); > > I think the problem is that the operand to stackrestore is the new > native sp register value to restore, and this code is assuming that > that will be a higher address than all the allocas that are being > unallocated. But on PowerPC...
2005 May 13
0
[LLVMdev] LongTy in LowerInvoke.cpp
.../Transforms/Scalar/LowerInvoke.cpp,v > retrieving revision 1.23 > diff -r1.23 LowerInvoke.cpp > 160c160 > < std::vector<Constant*> GEPIdx(2, Constant::getNullValue(Type::LongTy)); > --- >> std::vector<Constant*> GEPIdx(2, > Constant::getNullValue(XXX::IntPtrTy)); > 173c173 > < std::vector<Constant*> GEPIdx(2, Constant::getNullValue(Type::LongTy)); > --- >> std::vector<Constant*> GEPIdx(2, > Constant::getNullValue(XXX::IntPtrTy)); > > -Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/
2005 May 13
0
[LLVMdev] LongTy in LowerInvoke.cpp
...3 LowerInvoke.cpp >>> 160c160 >>> < std::vector<Constant*> GEPIdx(2, >>> Constant::getNullValue(Type::LongTy)); >>> --- >>> >>>> std::vector<Constant*> GEPIdx(2, >>> >>> Constant::getNullValue(XXX::IntPtrTy)); >>> 173c173 >>> < std::vector<Constant*> GEPIdx(2, >>> Constant::getNullValue(Type::LongTy)); >>> --- >>> >>>> std::vector<Constant*> GEPIdx(2, >>> >>> Constant::getNullValue(XXX::IntPtrTy)); &g...
2005 May 13
1
[LLVMdev] LongTy in LowerInvoke.cpp
On Fri, 2005-05-13 at 08:06 +0200, Markus F.X.J. Oberhumer wrote: > Actually that's the only case I stumbled over this problem in a somewhat > larger C++ program, and it's clearly the wrong type in LowerInvoke.cpp - > it really should be IntPtrTy. But maybe we could use just IntTy here to > avoid target dependencies. Wait a minute. You want to lower a 64 bit thing to a 32 bit and "avoid target dependencies" when the right type is a pointer? You know the 64-bit targets won't like this one bit. Andrew
2015 Nov 23
2
asan for allocas on powerpc64
...ress and "bottom" means highest! >>> >>> IRB.CreateCall( >>> AsanAllocasUnpoisonFunc, >>> { >>> IRB.CreateLoad(DynamicAllocaLayout), >>> IRB.CreatePointerToInt(SaveRestoreInst->getOperand(0), IntptrTy) >>> } >>> ); >>> >>> I think the problem is that the operand to stackrestore is the new >>> native sp register value to restore, and this code is assuming that >>> that will be a higher address than all the alloca...
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
2017 Jan 31
2
llvm.read_register for %RIP on x86_64
On Tue, Jan 31, 2017 at 3:11 PM, Renato Golin <renato.golin at linaro.org> wrote: > On 31 Jan 2017 8:58 p.m., "Kostya Serebryany" <kcc at google.com> wrote: > > hmm. I am not sure I understood you. The last two paragraphs seem to > contradict each other. > So, you recommend to extend read_register to read the PC, or > "read_register is locked at the
2015 Nov 23
2
asan for allocas on powerpc64
...gt;>>> >>>>> IRB.CreateCall( >>>>> AsanAllocasUnpoisonFunc, >>>>> { >>>>> IRB.CreateLoad(DynamicAllocaLayout), >>>>> IRB.CreatePointerToInt(SaveRestoreInst->getOperand(0), IntptrTy) >>>>> } >>>>> ); >>>>> >>>>> I think the problem is that the operand to stackrestore is the new >>>>> native sp register value to restore, and this code is assuming >>>>> that >&g...
2013 Nov 04
0
[LLVMdev] Implementing an llvm.setreturnaddress intrinsic
...rinsic: def int_setreturnaddress : Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty], []>; And I'm using it as follows: B.CreateCall2( Intrinsic::getDeclaration(M, Intrinsic::setreturnaddress), ConstantInt::get(Type::getInt32Ty(RI->getContext()), 0), B.CreateIntToPtr(ConstantInt::get(IntPtrTy, 0 /* testing */)), RA->getReturnType())); The problem I'm facing is that for some reason, my following line inside X86TargetLowering::LowerOperation is never getting called: case ISD::SETRETURNADDR: return LowerSETRETURNADDR(Op, DAG); This is despite the fact that I can confirm the f...
2017 Jan 31
0
llvm.read_register for %RIP on x86_64
On 31 Jan 2017 8:58 p.m., "Kostya Serebryany" <kcc at google.com> wrote: hmm. I am not sure I understood you. The last two paragraphs seem to contradict each other. So, you recommend to extend read_register to read the PC, or "read_register is locked at the stack pointer as a design decision"? Both. :-) There was a design decision to only support SP because we had no
2013 Jul 04
0
[LLVMdev] making a copy of a byval aggregate on the callee's frame
Hi, > I believe the LowerCall is doing what it needs to do - passing pointer either on the stack or in register as per ABI. >From very quick test-cases with no understanding of XCore, that looks plausible. > LowerFormalArguments () calls CCInfo.AnalyzeFormalArguments(Ins, CC_XCore), which calls the CC_XCore(). > This is where I placed the CCIfByVal<CCPassByVal<0,4>>
2013 Jul 04
2
[LLVMdev] making a copy of a byval aggregate on the callee's frame
...hack is - notice the "CreateMemCpy": CodeGenFunction::EmitFunctionProlog(){ ... if (ArgI.getIndirectByVal()) { llvm::AllocaInst *ByValue = CreateMemTemp(Ty, V->getName() + "agg.tmp"); llvm::ConstantInt * size = llvm::ConstantInt::get(IntPtrTy, getContext().getTypeSizeInChars(Ty).getQuantity()); Builder.CreateMemCpy(ByValue, V, size, 4 ); V = ByValue; // and point the pointer to the new pointee! } So, can it be done in the llvm? Should it be done in the llvm? I probably need to go aw...
2013 Jul 04
2
[LLVMdev] making a copy of a byval aggregate on the callee's frame
Hi Tim, Thank you for the input. I think I follow you. I believe the LowerCall is doing what it needs to do - passing pointer either on the stack or in register as per ABI. The LowerFormalArguments() is where I am stuck. LowerFormalArguments () calls CCInfo.AnalyzeFormalArguments(Ins, CC_XCore), which calls the CC_XCore(). This is where I placed the CCIfByVal<CCPassByVal<0,4>> which
2009 Jan 09
2
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...ddrLV.Ptr; + ArrayAlign = ArrayAddrLV.Alignment; } else { ArrayAddr = Emit(Array, 0); + ArrayAlign = expr_align(ArrayTreeType) / 8; } Value *IndexVal = Emit(Index, 0); @@ -5971,20 +5992,27 @@ LValue TreeToLLVM::EmitLV_ARRAY_REF(tree IndexVal = CastToSIntType(IndexVal, IntPtrTy); // If this is an index into an LLVM array, codegen as a GEP. - if (isArrayCompatible(ArrayType)) { + if (isArrayCompatible(ArrayTreeType)) { Value *Idxs[2] = { ConstantInt::get(Type::Int32Ty, 0), IndexVal }; Value *Ptr = Builder.CreateGEP(ArrayAddr, Idxs, Idxs + 2); - return...
2014 Nov 03
8
[LLVMdev] [PATCH] Protection against stack-based memory corruption errors using SafeStack
...ind/restore it prorerly. + // To work around this problem without changing the runtime, we insert + // instrumentation to restore the unsafe stack pointer when necessary. + SmallVector<Instruction*, 4> StackRestorePoints; + + Type *StackPtrTy = Type::getInt8PtrTy(F.getContext()); + Type *IntPtrTy = DL->getIntPtrType(F.getContext()); + Type *Int32Ty = Type::getInt32Ty(F.getContext()); + + // Find all static and dynamic alloca instructions that must be moved to the + // unsafe stack, all return instructions and stack restore points + for (inst_iterator It = inst_begin(&F), Ie = ins...