search for: getvalueasint

Displaying 12 results from an estimated 12 matches for "getvalueasint".

2009 Apr 15
3
[LLVMdev] Tablegen question
...(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 [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Bob Wilson Sent: Wednesday, April 15, 2009 9:...
2009 Apr 15
0
[LLVMdev] Tablegen question
...{ > 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 [mailto:llvmdev-bounces at cs.uiuc.edu] > On Behalf Of Bob Wilson &g...
2007 Feb 05
2
[LLVMdev] automatically generating intrinsic declarations
...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::get("; + EmitTypeGenerate(OS, ArgType->getValueAsDef("ElTy")); + OS << ", " << ArgType->getValueAsInt(...
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
2009 Apr 15
3
[LLVMdev] Tablegen question
...lt; " 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 [mailto:llvmdev- >> bounces at cs.uiuc.ed...
2007 Feb 06
1
[LLVMdev] automatically generating intrinsic declarations
...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::get("; + EmitTypeGenerate(OS, ArgType->getValueAsDef("ElTy")); + OS << ", " << ArgType->getValueAsInt(...
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
2009 Apr 15
0
[LLVMdev] Tablegen question
On Apr 15, 2009, at 9:29 AM, Villmow, Micah wrote: > 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?
2013 Jul 16
0
[LLVMdev] New Attribute Group broke bitcode compatibility
...ece of code: if (Attr.isEnumAttribute()) { Record.push_back(0); Record.push_back(Attr.getKindAsEnum()); } else if (Attr.isAlignAttribute()) { Record.push_back(1); Record.push_back(Attr.getKindAsEnum()); Record.push_back(Attr.getValueAsInt()); getKindAsEnum() returns the actual value of the enum, which is then stored in the bitcode. This direct connection makes the bitcode dependent of the order of elements in the enum, which causes changes like the above to break bitcode compatibility. Specifically, bitcode from LLVM 3.3 is curr...
2014 Mar 13
2
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...htAttrType)) > + return Res; > + > + switch (LeftAttrType) { > + case Enum: > + if (int Res = cmpNumbers(LA.getKindAsEnum(), RA.getKindAsEnum())) > + return Res; > + break; > + case Align: > + if (int Res = cmpNumbers(LA.getValueAsInt(), RA.getValueAsInt())) > + return Res; > + break; > + case Other: > + if (int Res = cmpStrings(LA.getKindAsString(), > RA.getKindAsString())) > + return Res; > + if (int Res = cmpStrings(LA.getValueAsString(), > RA.getValueAsStrin...
2009 Apr 15
0
[LLVMdev] Tablegen question
...lt; " 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 [mailto:llvmdev- >> bounces at cs.uiuc.ed...
2014 Feb 27
3
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
Hi Nick, I tried to rework changes as you requested. One of patches (0004 with extra assertions) has been removed. > + bool isEquivalentType(Type *Ty1, Type *Ty2) const { > + return cmpType(Ty1, Ty2) == 0; > + } > > Why do we still need isEquivalentType? Can we nuke this? Yup. After applying all the patches isEquivalentType will be totally replaced with cmpType. All