search for: attrbuilder

Displaying 20 results from an estimated 28 matches for "attrbuilder".

2013 Feb 09
3
[LLVMdev] Using the New Attributes Classes
...Raw', 'getRawPointer', etc.). These methods break encapsulation, and may be removed in a future release (i.e. 4.0). Lastly, we have a 'builder' class to help create the AttributeSet object without having to create several different intermediate uniqued AttributeSet objects. The AttrBuilder class allows you to add and remove attributes at will. The attributes won't be uniqued until you call the appropriate "AttributeSet::get" method. An AttrBuilder object is *not* designed to be passed around by value. It should be passed by reference. Note: It is advised that you do *...
2015 Mar 24
2
[LLVMdev] Propagate clang attribute to IR
...i, Thx for your answer... I tried that without any luck: static void handleOBF(Sema &S, Decl *D, const AttributeList &Attr) { D->addAttr(::new (S.Context)NoFLAAttr(Attr.getRange(), S.Context, Attr.getAttributeSpellingListIndex())); // ??????????? llvm::AttrBuilder FuncAttrs; FuncAttrs.addAttribute(); } In CodeGenModule::ConstructAttributeList it uses a AttrBuilder, I tried there to add a random attribute and it works. But I’m not understanding how to do that in SemaDeclAttr.cpp. Cheers
2013 Feb 09
0
[LLVMdev] Using the New Attributes Classes
...etc.). These methods break > encapsulation, > and may be removed in a future release (i.e. 4.0). > > Lastly, we have a 'builder' class to help create the AttributeSet object > without > having to create several different intermediate uniqued AttributeSet > objects. The AttrBuilder class allows you to add and remove attributes at > will. The attributes won't be uniqued until you call the appropriate > "AttributeSet::get" method. > > An AttrBuilder object is *not* designed to be passed around by value. It > should > be passed by reference. >...
2015 Jan 05
3
[LLVMdev] should AlwaysInliner inline this case?
...Call(CallSite CS) { Type *ParamTy = FT->getParamType(i); Type *ActTy = (*AI)->getType(); - if (!CastInst::isBitCastable(ActTy, ParamTy)) + if (!CastInst::isBitOrNoopPointerCastable(ActTy, ParamTy, DL)) return false; // Cannot transform this parameter value. if (AttrBuilder(CallerPAL.getParamAttributes(i + 1), i + 1). @@ -1551,7 +1551,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { if ((*AI)->getType() == ParamTy) { Args.push_back(*AI); } else { - Args.push_back(Builder->CreateBitCast(*AI, ParamTy)); + Args.push_back(...
2013 Jan 11
0
[LLVMdev] [RFC] Overhauling Attributes
...ething to atttributes.h, attributes.cpp in the interim until your full scheme is available. A new attribute called "target" would be added to AttrKind. And target can take a list of strings. target("foo", "goo") For example. I would add a component targetAttrs to AttrBuilder Will this meet with resistance if I try and put this back? Reed On 01/01/2013 04:07 AM, Bill Wendling wrote: > On Dec 31, 2012, at 4:37 AM, Duncan Sands <baldrick at free.fr> wrote: > >> Hi Bill, >> >> On 30/12/12 03:21, Bill Wendling wrote: >>> Hi Rafael,...
2015 Mar 24
2
[LLVMdev] Propagate clang attribute to IR
Hi, I want to *tag* some functions with some *flags*. I was using annotate((“myFlag”)) and everything was working fine until I tried on ObjC method. It seems that clang just ignore it. So, to be able to *flag* my functions I’m trying to add a *real* attribute to clang. I’ve added a new attribute to clang in tools/clang/include/clang/Basic/Attr.td: def NoFLA : Attr { let Spellings =
2013 Jan 11
1
[LLVMdev] [RFC] Overhauling Attributes
...t; interim until your full scheme is available. > > A new attribute called "target" would be added to AttrKind. > > And target can take a list of strings. > > target("foo", "goo") > > For example. > > I would add a component targetAttrs to AttrBuilder > > Will this meet with resistance if I try and put this back? > > Reed > > On 01/01/2013 04:07 AM, Bill Wendling wrote: >> On Dec 31, 2012, at 4:37 AM, Duncan Sands <baldrick at free.fr> wrote: >> >>> Hi Bill, >>> >>> On 30/12/12 03:21...
2013 Jan 31
3
[LLVMdev] Question about changes to llvm::Argument::addAttr(AttributeSet AS) API
...o store an array of Attribute(s) to construct an AttributeSet argument for addAttr I need to know the index of the Argument in the function? I can follow the lead of this code from Core.cpp: void LLVMAddAttribute(LLVMValueRef Arg, LLVMAttribute PA) { Argument *A = unwrap<Argument>(Arg); AttrBuilder B(PA); A->addAttr(AttributeSet::get(A->getContext(), A->getArgNo() + 1, B)); } Is this all I need? What does the A->getArgNo()+1 provide? The index of the argument in the function argument list+1? Is this change to the API described anywhere? Best, .Chris. -------------- next...
2017 Nov 23
1
JIT and atexit crash
Hi, Not sure whether this matches your use case, but the Orc-based JIT used in LLI appears to be using `llvm::orc::LocalCXXRuntimeOverrides` (http://llvm.org/doxygen/classllvm_1_1orc_1_1LocalCXXRuntimeOverrides.html) to override `__cxa_atexit`: https://github.com/llvm-mirror/llvm/blob/release_50/tools/lli/OrcLazyJIT.h#L74
2013 Jan 01
3
[LLVMdev] [RFC] Overhauling Attributes
On Dec 31, 2012, at 4:37 AM, Duncan Sands <baldrick at free.fr> wrote: > Hi Bill, > > On 30/12/12 03:21, Bill Wendling wrote: >> Hi Rafael, >> >> Sorry, I forgot to respond to this. They can be arbitrary strings that are known only to the specific back-end. It may be beneficial to define them inside of the LangRef document though. > > this sounds so much
2012 Oct 16
0
[LLVMdev] Changing Alignment Attribute using New Attribute API
Dear All, Under the old attribute API, when we modified the alignment attribute of a byval argument in a caller or callee, we first removed the old alignment attribute and then added a new alignment attribute. With the new API, can I just use the AttrBuilder to build the alignment attribute and then use the addAttribute() method of CallInst and Argument to overwrite the old alignment attribute? -- John T.
2013 Mar 13
0
[LLVMdev] attributes helper functions - please review
...tributes.cpp (revision 176874) +++ lib/IR/Attributes.cpp (working copy) @@ -649,6 +649,13 @@ return addAttributes(C, Idx, AttributeSet::get(C, Idx, Attr)); } +AttributeSet AttributeSet::addAttribute(LLVMContext &C, unsigned Idx, + StringRef Kind) const { + llvm::AttrBuilder B; + B.addAttribute(Kind); + return addAttributes(C, Idx, AttributeSet::get(C, Idx, B)); +} + AttributeSet AttributeSet::addAttributes(LLVMContext &C, unsigned Idx, AttributeSet Attrs) const { if (!pImpl) return Attrs;
2013 Jul 05
0
[LLVMdev] Building function parameter AttributeSets quickly
...s via the addAttribute methods of the Function class or the AttributeSet. This is quite inefficient as a new AttributeSet is constructed every time. In fact, it takes the bulk of the time my codegen consumes when dealing with large parameter sets. "HowToUseAttributes" suggests that AttrBuilder can be used as a mutable helper for this purpose. However, it seems to me that this can build the set of attributes that describe a single parameter, rather than a full set with indices. I'm essentially looking for something like: static AttributeSet get(LLVMContext &C, ArrayRef<s...
2019 Mar 14
4
[RFC] We are running out of slots in the Attribute::AttrKind enum
I would like to add a target-dependent attribute to the LLVM IR, and the guidance in http://llvm.org/docs/HowToUseAttributes.html says that target-dependent attributes should not occupy a slot in the Attribute::AttrKind enum, but I have yet to find an attribute that is represented in the IR that does not also have a slot in the AttrKind enum. We are limited to 63 slots in the AttrKind enum
2012 Nov 26
3
[LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
...ttribute. >> int Alignment = A.getIntValue(Attributes::Alignment); >> >> // Retrieving value of a target-dependent attribute. >> StringRef CPU = A.getStringValue("cpu"); > > Maybe some set attribute examples too? > That would be done through the current AttrBuilder class: AttrBuilder B; // Add a target-independent attribute. B.addAttribute(Attributes::NoInline); // Add a target-dependent attribute. B.addAttribute("no-sse"); // Create the attribute object. Attributes A = Attributes::get(Context, B); > Overall, I think this is a nice ad...
2013 Feb 05
0
[LLVMdev] Question about changes to llvm::Argument::addAttr(AttributeSet AS) API
...tributeSet argument for addAttr I need to know the index of the Argument in the function? > That's correct. > I can follow the lead of this code from Core.cpp: > > void LLVMAddAttribute(LLVMValueRef Arg, LLVMAttribute PA) { > Argument *A = unwrap<Argument>(Arg); > AttrBuilder B(PA); > A->addAttr(AttributeSet::get(A->getContext(), A->getArgNo() + 1, B)); > } > > > Is this all I need? What does the A->getArgNo()+1 provide? The index of the argument in the function argument list+1? > Yes. :-) It's the index of the argument into the...
2016 Mar 24
0
attribute of intrinsic function
> On Mar 24, 2016, at 12:45 PM, Xiangyang Guo via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi, > > When I define an intrinsic function with memory write permission, my assumption is that we can either attach [IntrReadWriteArgMem] or [] to the intrinsic function. Based on the comment of the source code , "IntrReadWriteArgMem - This intrinsic reads and writes
2012 Nov 20
0
[LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
On Nov 13, 2012, at 12:20 AM, Bill Wendling wrote: > IR Changes > ---------- > > The attributes will be specified within the IR. This allows us to generate code > that the user wants. This also has the advantage that it will no longer be > necessary to specify all of the command line options when compiling the bit code > (via 'llc' or 'clang'). E.g.,
2013 Jan 11
0
[LLVMdev] adding IR attributes to llvm
I think that Bill Wendlings new attribute implementation would allow me to do this but it is not ready yet. Maybe it's okay to just add them to the list of function attributes as I suggested. But in the end, someone has to approve the checkin. On 01/11/2013 07:35 AM, Reed Kotler wrote: > Yes, you could have mips16 and fastcc. > > Mips16 just means that processor mode to execute
2013 Jan 11
2
[LLVMdev] adding IR attributes to llvm
Yes, you could have mips16 and fastcc. Mips16 just means that processor mode to execute that function is "mips16". So in a mips16 designated function, I will just emit mips16 instructions and in a "nomips16" function, just emit normal mips32 instructions. I tend to call this "mips32" normal mode, "standard encoding" because in reality the processor is