[LLVMdev] CPP API User-level Question: Returning multiple values

heisenbug ggreif at gmail.com
Fri Sep 12 10:44:47 PDT 2008


On Sep 12, 6:40 pm, Tony Scudiero <ts... at cray.com> wrote:
> Greetings,
>     I'm working on getting our compiler's interface to LLVM to mimic the
> way the LLVM-GCC inserts instructions to generate AMD64 ABI compliant
> code. I'm trying to create
>
>      ret i64 %mrv, double %double_mrv37
>
>     which is basically what LLVM-GCC puts out. However if I use lcc
> -march=cpp to get the API code I need it has the following line:
>
>     ReturnInst::Create(int64_t93, label_return);
>
>     with no reference to the double. I also can't find anything in the
> doxygen docs for a version of ReturnInst::Create( ) that takes two
> values for returning, nor could I find anything by generating an
> intentionally bad call and letting my gen-compiler list the possible
> ReturnInst which it knows about. Do I have to create the ReturnInst in a
> different way to do this? Any guidance for how to do this from within
> the CPP API would be greatly appreciated. Thanks!!

Hi Tony,

this is probably a bug in the CPP "back end". You have exercised an as
of yet untriggered condition and CPP happens to output uncompilable
code.

Just go to the CppEmitter, modify each string literal the contains
"ReturnInst::Create" with a unique comment and rebuild. On your next
attempt to compile using llc you will get a nice hint which line
in teh emitter is the guilty one.

Cheers,

   Gabor


>
>     -Tony Scudiero
>
> _______________________________________________
> LLVM Developers mailing list
> LLVM... at cs.uiuc.edu        http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list