search for: classifyargumenttyp

Displaying 11 results from an estimated 11 matches for "classifyargumenttyp".

Did you mean: classifyargumenttype
2012 Oct 08
1
[LLVMdev] Fwd: Multiply i8 operands promotes to i32
...cantions you can do the following to bypass argument promotion: 1) go to the lib/CodeGen/TargetInfo.cpp (clang codebase) 2) implement a MSP430ABIInfo class derived from ABIInfo, check how other targets do it in the same file. The important part here is how you implement the classifyReturnType and classifyArgumentType functions, they should basically look like this: class MSP430ABIInfo : public ABIInfo { public: MSP430ABIInfo (CodeGenTypes &CGT) : ABIInfo(CGT) {} ABIArgInfo classifyReturnType(QualType RetTy) const; ABIArgInfo classifyArgumentType(QualType RetTy) const; virtual void computeInfo(CG...
2015 Jul 23
0
[LLVMdev] signext on function parameters and return.
...ther clang uses signext vs something else? If so, how does this > target query work? Yes, the function signature in the IR is target specific since it already contains some ABI information at this point. I know Mips would use the definition above but other targets may vary. The target hook is classifyArgumentType() and classifyReturnType() in tools/clang/lib/CodeGen/TargetInfo.cpp and returning ABIArgInfo::getExtend() causes the signext/zeroexts to be emitted appropriately for the type. > 2) Does the presence of the signext mean it's imperative to sign > extend, or that extension, only if needed...
2015 Jul 23
2
[LLVMdev] signext on function parameters and return.
Hello, For a simple function taking a short and returning a short, clang generates IR with this function signature: define signext i16 @foo(i16 signext %x) Some questions please: 1) For the input parameter and return value, does the target control whether clang uses signext vs something else? If so, how does this target query work? 2) Does the presence of the signext mean it's imperative
2012 Jun 13
2
[LLVMdev] Structs passed by value
...are passed to functions to use pass-by-value. Currently LLVM's default behavior is to pass structures by reference. I'm not disputing the benefits of this but I really want to change the default behavior for experimentation purposes. To this end I've changed the code in DefaultABIInfo::classifyArgumentType() to use the different types. What I've found is that none of the options yield the expected results for the input code (see below). Except for the indirect case, the function signature is changed to take each structure element. How can I modify LLVM to pass structures by value? Thanks, Javie...
2012 Jun 14
0
[LLVMdev] Structs passed by value
...copy of the pointee is made between the caller and the callee, so the callee is unable to modify the value in the caller." etc... Is the problem that in the backend, you do not see a copy being made? **** > > ** ** > > To this end I’ve changed the code in > DefaultABIInfo::classifyArgumentType() to use the different types. What > I’ve found is that none of the options yield the expected results for the > input code (see below). Except for the indirect case, the function > signature is changed to take each structure element. How can I modify LLVM > to pass structures by value...
2015 Mar 17
2
[LLVMdev] Alias analysis issue with structs on PPC
...tion at the ABI level might be tricky. > I've cc'd Uli, who did most of the recent work here. > > For the single-element struct case, we could fix this by keeping it > a pointer type. The relevant code in Clang is in lib/CodeGen/ > TargetInfo.cpp (look at PPC64_SVR4_ABIInfo::classifyArgumentType and > nearby code). But that does not really address the underlying issue: > > If I take your example and modify it so that we have: > > struct box { > double* source; > double* source2; > }; > > then the parameter is passed as: > > define void @test(dou...
2015 Jul 23
1
[LLVMdev] signext on function parameters and return.
On Thu, Jul 23, 2015 at 3:59 AM, Daniel Sanders <Daniel.Sanders at imgtec.com> wrote: > > The target hook is classifyArgumentType() and classifyReturnType() in tools/clang/lib/CodeGen/TargetInfo.cpp and returning ABIArgInfo::getExtend() causes the signext/zeroexts to be emitted appropriately for the type. Thanks for the great help. Should these classify calls be moved down into the ABIInfo base class? They also are not ma...
2016 Feb 16
0
Intrinsic opt failure
On 2/16/2016 8:44 AM, Konstantin Vladimirov via llvm-dev wrote: > > CI->getArgOperand(0) returns operand with type (double*) rather then > double, because in our ABI doubles are passed via memory. The LLVM intrinsics in the LLVM IR must conform to whatever the IR's requirements are. That means that even in the case of your backend, the arguments to the intrinsic must be doubles,
2016 Feb 16
2
Intrinsic opt failure
Hi, Working on private backend, based on llvm-3.7 Inside lib/Transforms/InstCombine/InstCombineCompares.cpp there is attempt to optimize fabs: if (F->getIntrinsicID() == Intrinsic::fabs || ... switch (I.getPredicate()) { ... case FCmpInst::FCMP_OGT: return new FCmpInst(FCmpInst::FCMP_ONE, CI->getArgOperand(0), RHSC); But CI->getArgOperand(0)
2019 Oct 25
4
unnecessary reload of 8-byte struct on i386
Hello folks, I've recently been looking at the generated code for a few functions in Chromium while investigating crashes, and I came across a curious pattern. A smallish repro case is available at https://godbolt.org/z/Dsu1WI . In that case, the function Assembler::emit_arith receives a struct (Operand) by value and passes it by value to another function. That struct is 8 bytes long, so the
2015 Mar 15
5
[LLVMdev] Alias analysis issue with structs on PPC
On Sun, Mar 15, 2015 at 4:34 PM Olivier Sallenave <ol.sall at gmail.com> wrote: > Hi Daniel, > > Thanks for your feedback. I would prefer not to write a new AA. Can't we > directly implement that traversal in BasicAA? > Can I ask why? Outside of the "well, it's another pass", i mean? BasicAA is stateless, so you can't cache, and you really don't