search for: argtype

Displaying 20 results from an estimated 43 matches for "argtype".

2007 Feb 05
2
[LLVMdev] automatically generating intrinsic declarations
...e intrinsic verifier. EmitVerifier(Ints, OS); + // Emit the intrinsic declaration generator. + EmitGenerator(Ints, OS); + // Emit mod/ref info for each function. EmitModRefInfo(Ints, OS); @@ -121,6 +124,19 @@ } } +static void EmitTypeGenerate(std::ostream &OS, Record *ArgType) { + if (ArgType->isSubClassOf("LLVMIntegerType")) { + OS << "IntegerType::get(" << ArgType->getValueAsInt("Width") << ")"; + } else if (ArgType->isSubClassOf("LLVMPackedType")) { + OS << "PackedType::ge...
2007 Feb 05
0
[LLVMdev] automatically generating intrinsic declarations
On Mon, 5 Feb 2007, Dan Gohman wrote: > LLVM knows what all the types of the intrinsic functions are; I thought, > why are users (including llvm-gcc...) required to duplicate all this > information in order to use them? I mean in order to call > getOrInsertFunction to get declarations for them. That is an excellent question! :) In the bad old days, we used to allow intrinsics
2007 Feb 06
1
[LLVMdev] automatically generating intrinsic declarations
...e intrinsic verifier. EmitVerifier(Ints, OS); + // Emit the intrinsic declaration generator. + EmitGenerator(Ints, OS); + // Emit mod/ref info for each function. EmitModRefInfo(Ints, OS); @@ -121,6 +124,25 @@ } } +static void EmitTypeGenerate(std::ostream &OS, Record *ArgType) { + if (ArgType->isSubClassOf("LLVMIntegerType")) { + OS << "IntegerType::get(" << ArgType->getValueAsInt("Width") << ")"; + } else if (ArgType->isSubClassOf("LLVMPackedType")) { + OS << "PackedType::ge...
2009 Apr 15
3
[LLVMdev] Tablegen question
...ntrinsicEmitter::EmitTypeGenerate, called from IntrinsicEmitter::EmitGenerator, here for (unsigned j = 0; j != N; ++j) { OS << " ArgTys.push_back("; EmitTypeGenerate(OS, ParamTys[j], ArgNo); OS << ");\n"; } I'm hitting this assertion: if (ArgType->isSubClassOf("LLVMMatchType")) { unsigned Number = ArgType->getValueAsInt("Number"); assert(Number < ArgNo && "Invalid matching number!"); Where both Number and ArgNo are 1. -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [ma...
2018 Jan 24
2
[llvm] r322838 - [ADT] Split optional to only include copy mechanics and dtor for non-trivial types.
...; > else { > - *this = std::move(*O); > + *this = std::move(*O.getPointer()); > O.reset(); > } > return *this; > } > > - /// Create a new object by constructing it in place with the given > arguments. > - template <typename... ArgTypes> void emplace(ArgTypes &&... Args) { > - reset(); > - hasVal = true; > - new (storage.buffer) T(std::forward<ArgTypes>(Args)...); > - } > - > - static inline Optional create(const T *y) { > - return y ? Optional(*y) : Optional(); > - } > -...
2009 Apr 15
0
[LLVMdev] Tablegen question
...alled from > IntrinsicEmitter::EmitGenerator, here > for (unsigned j = 0; j != N; ++j) { > OS << " ArgTys.push_back("; > EmitTypeGenerate(OS, ParamTys[j], ArgNo); > OS << ");\n"; > } > I'm hitting this assertion: > if (ArgType->isSubClassOf("LLVMMatchType")) { > unsigned Number = ArgType->getValueAsInt("Number"); > assert(Number < ArgNo && "Invalid matching number!"); > > Where both Number and ArgNo are 1. > > -----Original Message----- > From: llv...
2018 Jan 24
0
[llvm] r322838 - [ADT] Split optional to only include copy mechanics and dtor for non-trivial types.
...= std::move(*O); >> + *this = std::move(*O.getPointer()); >> O.reset(); >> } >> return *this; >> } >> >> - /// Create a new object by constructing it in place with the given >> arguments. >> - template <typename... ArgTypes> void emplace(ArgTypes &&... Args) { >> - reset(); >> - hasVal = true; >> - new (storage.buffer) T(std::forward<ArgTypes>(Args)...); >> - } >> - >> - static inline Optional create(const T *y) { >> - return y ? Optional(*y) :...
2013 May 29
2
[LLVMdev] CloneFunctionInto() Error
...0x00000000005285b3 main + 7251 13 libc.so.6 0x00007f039618076d __libc_start_main + 237 14 opt 0x0000000000521f91 Stack dump: 0. Program arguments: opt -load ../../../Release+Asserts/lib/Blocks.so -blocks Aborted (core dumped) ***The code is > std::vector<Type*> ArgTypes; > ValueToValueMapTy VMap; >FunctionType *FTy = FunctionType::get(F.getFunctionType()->getReturnType(), ArgTypes, F.getFunctionType()->isVarArg()); >Function *NewF = Function::Create(FTy, F.getLinkage(), F.getName()); > SmallVector<ReturnInst*,...
2010 Sep 07
0
[LLVMdev] Intrinsic prototype has incorrect number of arguments!
..., 2010, at 11:30 AM, F van der Meeren wrote: > > > Any ideas on what I am doing wrong here ? > Why not just use something like: const Type *ArgPtr = Type::getInt8PtrTy(Context); const Type *IntPtr = getTargetData().getIntPtrType(Context); and then: const Type *ArgTypes[3] = {ArgPtr, ArgPtr, IntPtr }; Intrinsic::getDeclaration(TheModule, Intrinsic::memcpy, ArgTypes, 3) to get the type of memcpy? Trying to declare it that way is likely confusing to the system. -eric
2018 Jan 24
1
[llvm] r322838 - [ADT] Split optional to only include copy mechanics and dtor for non-trivial types.
...= std::move(*O.getPointer()); > >> O.reset(); > >> } > >> return *this; > >> } > >> > >> - /// Create a new object by constructing it in place with the given > >> arguments. > >> - template <typename... ArgTypes> void emplace(ArgTypes &&... Args) { > >> - reset(); > >> - hasVal = true; > >> - new (storage.buffer) T(std::forward<ArgTypes>(Args)...); > >> - } > >> - > >> - static inline Optional create(const T *y) { > >&...
2006 May 11
1
Simulating scalar-valued stationary Gaussian processes
Hi, I have a sample of size 100 from a function in interval [0,1] which can be assumed to come from a scalar-valued stationary Gaussian process. There are about 500 observation points in the interval. I need an effective and fast way to simulate from the Gaussian process conditioned on the available data. I can of course estimate the mean and 500x500 covariance matrix from data. I have searched
2010 Sep 07
2
[LLVMdev] Intrinsic prototype has incorrect number of arguments!
I have created the function prototype with the following code: const uintmax_t methodNameSize = 1024; const char methodNameTemplate[] = "llvm.memcpy.p0i%llu.p0i%llu.i%llu"; char methodName[methodNameSize]; // Create the methodName. memset(methodName, 0, methodNameSize); sprintf(methodName, methodNameTemplate, dstSize, srcSize, lengthSize); // Search for the
2016 Oct 29
1
Problems with Inline ASM expressions generated in the back end
...her - maybe when deleting SDNode the destructor frees the char *. // This seems to be so because of this method doing creation of the SDNode, which is used also by getTargetExternalSymbol(): template <typename SDNodeT, typename... ArgTypes> SDNodeT *newSDNode(ArgTypes &&... Args) { return new (NodeAllocator.template Allocate<SDNodeT>()) SDNodeT(std::forward<ArgTypes>(Args)...); } */ char *exprStrChar = (char *)malloc(2048);...
2013 May 29
0
[LLVMdev] CloneFunctionInto() Error
...0007f039618076d __libc_start_main + 237 > 14 opt 0x0000000000521f91 > Stack dump: > 0. Program arguments: opt -load ../../../Release+Asserts/lib/Blocks.so > -blocks > Aborted (core dumped) > > > > ***The code is > > > > std::vector<Type*> ArgTypes; > > > ValueToValueMapTy VMap; > > >FunctionType *FTy = > FunctionType::get(F.getFunctionType()->getReturnType(), > ArgTypes, F.getFunctionType()->isVarArg()); > > >Function *NewF = Function::Create(FTy, F.getLinkage(), F.getName())...
2011 Jan 18
2
[LLVMdev] compiling a call to function in compiler
...rtion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file /usr/local/include/llvm/Support/Casting.h, line 202. Code snippets... id testfunc(id a, id b) { ... } ... FunctionType *fn_type = FunctionType::get(id_type, argtypes, false); Value *fn = ConstantExpr::getIntToPtr(ConstantInt::get(int64_type, reinterpret_cast<int64_t>(testfunc)), fn_type); return builder.CreateCall2(fn, arg0val, arg1val); // <-- assertion fails here What am I doing wrong? I can paste more code if needed. thanks, Rob
2011 Jul 18
5
[LLVMdev] dragonegg svn still broken
...version] gs->gsbase.subcode &= ~GF_PREDICT_TAKEN; ^ ~~~~~~~~~~~~~~~~~ /sw/src/fink.build/dragonegg-gcc45-3.0-1/dragonegg-3.0/src/Convert.cpp:429:64: error: too many arguments to function call, expected 3, have 4 ArgTypes, 3), Ops); ^ /sw/opt/llvm-3.0/include/llvm/Intrinsics.h:71:3: note: 'getDeclaration' declared here Function *getDeclaration(Module *M, ID id, ^ /sw/src/fink.build/dragonegg-gcc45-3.0-1/dragonegg-3.0/src/Convert.cpp:1674:58:...
2011 Jul 18
0
[LLVMdev] dragonegg svn still broken
...t;gsbase.subcode &= ~GF_PREDICT_TAKEN; > ^ ~~~~~~~~~~~~~~~~~ > /sw/src/fink.build/dragonegg-gcc45-3.0-1/dragonegg-3.0/src/Convert.cpp:429:64: > error: too many arguments to function call, expected 3, have 4 > ArgTypes, 3), Ops); > ^ > /sw/opt/llvm-3.0/include/llvm/Intrinsics.h:71:3: note: 'getDeclaration' > declared here > Function *getDeclaration(Module *M, ID id, > ^ > /sw/src/fink.build/dragonegg-gcc45-3.0-1/dragonegg-3...
2009 Apr 15
3
[LLVMdev] Tablegen question
...cEmitter::EmitGenerator, here >> for (unsigned j = 0; j != N; ++j) { >> OS << " ArgTys.push_back("; >> EmitTypeGenerate(OS, ParamTys[j], ArgNo); >> OS << ");\n"; >> } >> I'm hitting this assertion: >> if (ArgType->isSubClassOf("LLVMMatchType")) { >> unsigned Number = ArgType->getValueAsInt("Number"); >> assert(Number < ArgNo && "Invalid matching number!"); >> >> Where both Number and ArgNo are 1. >> >> -----Original Messa...
2011 Jul 06
2
[LLVMdev] First steps with LLVM and partial evaluation
...; #include "llvm/ADT/DenseMap.h" #include "llvm/Transforms/Utils/Cloning.h" using namespace std; using namespace llvm; static Function *cloneFunctionInfo(const Function *F, ValueToValueMapTy& ValueMap) { vector<const Type*> ArgTypes; // The user might be deleting arguments to the function by specifying them in // the ValueMap. If so, we need to not add the arguments to the arg ty vector // for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I) if (ValueMap.co...
2009 Apr 15
2
[LLVMdev] Tablegen question
I have this intrinsic definition for llvm. def int_opencl_math_fdistance_fast : Intrinsic<[llvm_float_ty], [llvm_anyfloat_ty, LLVMMatchType<0>]>; Can someone explain what LLVMMatchType does and how to specify it to match the first argument and not the return value? I've tried LLVMMatchType<1> but it fails in IntrinsicEmitter.cpp