[llvm-dev] Intrinsic opt failure

Konstantin Vladimirov via llvm-dev llvm-dev at lists.llvm.org
Thu Feb 25 06:52:34 PST 2016


Hi,

Thanks a lot for correction, I rewritten and debugged some code and
now everything works: I really should process calling convention in
argument lowering inside llvm backend, not in classifyArgumentType
inside ABIInfo inherited class in clang codegen. This is not at all
obvious: correcting arguments at early stages looks simpler, but leads
to tricky problems with high-level IR optimizations.

---
With best regards, Konstantin

On Tue, Feb 16, 2016 at 6:07 PM, Krzysztof Parzyszek via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> 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, not their addresses.  You can
> convert the intrinsics to function calls, together with the call frame set
> up, etc. during instruction selection.
>
> Check setLibcallName, setLibcallCallingConv (and related functions) in
> include/llvm/Target/TargetLowering.h.  The Libcall enum is defined in
> include/llvm/CodeGen/RuntimeLibcalls.h
>
> -Krzysztof
>
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
> The Linux Foundation
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list