search for: getaddressspac

Displaying 20 results from an estimated 58 matches for "getaddressspac".

Did you mean: getaddressspace
2011 Aug 24
1
[LLVMdev] proposal: add macro expansion of for-loop to TableGen
...ce) ---------------------------------------- def load_global : PatFrag<(ops node:$ptr), (load node:$ptr), [{  const Value *Src;  const PointerType *PT;  if ((Src = cast<LoadSDNode>(N)->getSrcValue()) &&      (PT = dyn_cast<PointerType>(Src->getType())))    return PT->getAddressSpace() == PTX::GLOBAL;  return false; }]>; def load_constant : PatFrag<(ops node:$ptr), (load node:$ptr), [{  const Value *Src;  const PointerType *PT;  if ((Src = cast<LoadSDNode>(N)->getSrcValue()) &&      (PT = dyn_cast<PointerType>(Src->getType())))    return PT->...
2008 Sep 18
2
[LLVMdev] store addrspace qualifier
...tr.Val); const Value* dstVal = svdstVal->getValue(); int addressSpace = ADDRESS_NONE; const Type* dstType = dstVal->getType(); if (isa<PointerType>(dstType)) { const PointerType* ptrType = cast<PointerType>(dstType); addressSpace = ptrType->getAddressSpace(); } printf("Addr: %d\n", addressSpace); SDValue Res; .... return Res; } Any idea what I'm doing wrong or how I can get this to work correctly? Thanks, Micah ________________________________ From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at...
2009 Apr 28
1
[LLVMdev] AddressSpace of a GlobalAddress
Every GlobalAddress has a GlobalValue, Every GlobalValue is a PointerType, Every PointerType has an AddressSpace. So is it ok to add a method getAddressSpace in GlobalAddressSDNode class itself? Currently we have to do GSDN->getGlobal()->getType()->getAddressSpace(). - Sanjiv
2016 Nov 28
2
LLVM Pass for Instructions in Function (error
...ementPtr){ Value* AddrPointer = Inst->getIperand(0); .... if (cast<Operator>(Inst) -> getOpcode() == Instruction::GetElementPtr){ Value* AddrPointer = cast<Value>(Inst); Value* threadId = Inst -> getOperand(1); unsigned AddrSpace = Inst -> getAddressSpace() DataStructureForTrace.push_back (std:make_tuple(new Value(threadId), AddrSpace, 0, new Value(AddrPointer))); } } I get following error (there are more, some visible here and some not. for eg, getAddressSpace not being for Instruction class.): error: cannot convert ‘llvm::inst_itera...
2008 Sep 17
0
[LLVMdev] store addrspace qualifier
The address qualifier is stored in the type of %result. From that operand, you can get the Value and then call getType. The type for result should be a PointerType which you cast to a PointerType and get the getAddressSpace e.g. cast<PointerType>(Ty)->getAddressSpace() -- Mon Ping On Sep 17, 2008, at 1:06 PM, Villmow, Micah wrote: > How do I access the address qualifier from the store instruction. > Given the following code: > > define void @test_unary_op_anegate(float %x, float addrspace(11)...
2008 Jul 21
2
[LLVMdev] Casting between address spaces and address space semantics
...type can be + // changed in the cast in addition to the address space. + const PointerType *DestTy = cast<PointerType>(CI.getDestTy()); + const PointerType *SrcTy = cast<PointerType>(CI.getSrcTy()); + const PointerType *NTy = PointerType::get(DestTy->getElementType(), SrcTy->getAddressSpace()); + + // Only propagate the address space when the source and dest address spaces + // are equivalent, or the source address space is a subset of the target + // address space. + AddrspacesDescriptor::AddrspaceRelation Rel; + Rel = TD->getAddrspaceRelation(SrcTy->getAddressSpace()...
2008 Sep 17
2
[LLVMdev] store addrspace qualifier
How do I access the address qualifier from the store instruction. Given the following code: define void @test_unary_op_anegate(float %x, float addrspace(11)* %result) nounwind { entry: %neg = sub float -0.000000e+000, %x ; <float> [#uses=1] store float %neg, float addrspace(11)* %result ret void } When I attempt to generate this code, I'm
2016 Nov 28
2
LLVM Pass for Instructions in Function (error
...inter = Inst->getIperand(0); > .... > > if (cast<Operator>(Inst) -> getOpcode() == Instruction::GetElementPtr){ > Value* AddrPointer = cast<Value>(Inst); > Value* threadId = Inst -> getOperand(1); > unsigned AddrSpace = Inst -> getAddressSpace() > DataStructureForTrace.push_back (std:make_tuple(new Value(threadId), AddrSpace, 0, new Value(AddrPointer))); > } > } > > I get following error (there are more, some visible here and some not. for eg, getAddressSpace not being for Instruction class.): > > erro...
2009 Nov 06
2
[LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything
...entified object either. I'm not sure what you mean by generalizing. Do you mean I should do the check on O1 and O2, which are the results of calls to getUnderlyingObject? Something like: if (const ConstantPointerNull *CPN = dyn_cast<ConstantPointerNull>(O1)) if (CPN->getType()->getAddressSpace() == 0) return NoAlias; and the same for O2 (maybe extract it into a function?) / Hans > > Dan >
2009 Jun 17
2
[LLVMdev] Localizing Globals ?
...place a variable into different memory space. The original idea of user might be to save on the stack space (data memory) and hence he asked the variable to be placed into different memory space (program memory). So the best bet here is to deny this optimization by checking GV->getType()->getAddressSpace() == 0. - Sanjiv -------------- next part -------------- A non-text attachment was scrubbed... Name: test.bc Type: application/octet-stream Size: 1496 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090617/5068f2aa/attachment.obj>
2009 Jun 16
0
[LLVMdev] Localizing Globals ?
...have a testcase that breaks? > How do I deny this optimization in that case? Can I find address space > for stack from AllocaInst and then compare the address spaces for two? An alloca is guaranteed to be in address space zero, so you can just check something like "GV->getType()->getAddressSpace() == 0". -Eli
2008 Jul 21
0
[LLVMdev] Casting between address spaces and address space semantics
...nged in the cast in addition to the address space. > + const PointerType *DestTy = cast<PointerType>(CI.getDestTy()); > + const PointerType *SrcTy = cast<PointerType>(CI.getSrcTy()); > + const PointerType *NTy = PointerType::get(DestTy- > >getElementType(), SrcTy->getAddressSpace()); > + > + // Only propagate the address space when the source and dest > address spaces > + // are equivalent, or the source address space is a subset of the > target > + // address space. > + AddrspacesDescriptor::AddrspaceRelation Rel; > + Rel = TD->getAddrs...
2008 Jul 18
0
[LLVMdev] Casting between address spaces and address space semantics
Hi Eli, Mon Ping, > In ISO/IEC WG14 n1169 on the C extensions to support embedded > processors, any two address spaces must be disjoint, must be > equivalent, or must be nested. Ah, that standard is a lot clearer on this subject than the DSP-C one I read was. > As Eli indicated, the actual relationship is platform specific depending on > what makes the most sense for
2009 Jun 16
3
[LLVMdev] Localizing Globals ?
The code excerpt is from IPO/GlobalOpt.cpp // If this is a first class global and has only one accessing function // and this function is main (which we know is not recursive we can make // this global a local variable) we replace the global with a local alloca // in this function. // // NOTE: It doesn't make sense to promote non single-value types since we // are
2012 Nov 09
2
[LLVMdev] [NVPTX] llc -march=nvptx64 -mcpu=sm_20 generates invalid zero align for device function params
Hi Dmitry, > I'm attaching a patch that should fix the issue mentioned above. It > simply makes the same check seen in the same file for global > variables: > > emitPTXAddressSpace(PTy->getAddressSpace(), O); > if (GVar->getAlignment() == 0) > O << " .align " << (int) TD->getPrefTypeAlignment(ETy); > else > O << " .align " << GVar->getAlignment(); it's not quite the same because your patch uses the ABI alignmen...
2015 Apr 21
2
[LLVMdev] Using an alias analysis pass
...getType()); > const PointerType *PT2 = dyn_cast<const PointerType>(V2->getType()); > > // The logic here is very simple: pointers to two different address spaces > // cannot alias. > if (PT1 != nullptr && PT2 != nullptr) > { > if (PT1->getAddressSpace() != PT2->getAddressSpace()) > { > return NoAlias; > } > } > > return AliasAnalysis::alias(LocA, LocB); > } > > virtual void *getAdjustedAnalysisPointer(AnalysisID PI) override > { > if (PI == &AliasAnalysis::ID) > r...
2008 Jul 17
4
[LLVMdev] Casting between address spaces and address space semantics
In ISO/IEC WG14 n1169 on the C extensions to support embedded processors, any two address spaces must be disjoint, must be equivalent, or must be nested. As Eli indicated, the actual relationship is platform specific depending on what makes the most sense for your hardware and how the program will behave will depend on that relationship. -- Mon Ping On Jul 17, 2008, at 7:25 AM, Eli
2017 Mar 24
2
Problem about API difference between LLVM3.5 and LLVM3.9
...gument type!" and I can determine that the error APIs are mutateType()(3rd line)or getArgumentList().insertAfter()(10th line) between LLVM3.5 and LLVM3.9. Anyone came across the same problem or knew the error API above? Thanks a lot! 1 unsigned address_space = func->getType()->getAddressSpace(); 2 FunctionType *new_type = FunctionType::get(new_return_type, arg_types, type->isVarArg( )); 3 func->mutateType(PointerType::get(new_type, address_space)); 4 //Duplicate arguments 5 std::vector<Argument *> arg_list; 6 for each_custom(arg, *f...
2009 Jun 17
0
[LLVMdev] Localizing Globals ?
...different memory space. The original idea of user > might be to save on the stack space (data memory) and hence he asked the > variable to be placed into different memory space (program memory). So the > best bet here is to deny this optimization by checking > > GV->getType()->getAddressSpace() == 0. Yeah, that sounds good; mind putting together a patch? -Eli
2009 Nov 07
0
[LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything
...9;m not sure what you mean by generalizing. > Do you mean I should do the check on O1 and O2, which are the results of calls to getUnderlyingObject? > > Something like: > > if (const ConstantPointerNull *CPN = dyn_cast<ConstantPointerNull>(O1)) > if (CPN->getType()->getAddressSpace() == 0) > return NoAlias; > > and the same for O2 (maybe extract it into a function?) Yes, thanks. Dan