[llvm-dev] A strange problem about type i64 for LLVM

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 12 08:16:18 PDT 2017

On 12 July 2017 at 11:10, Qiuping Yi via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> int64_t myFunction() {
>      int64_t retValue;
>      ...
>      std::cout << "retValue: " << retValue << "\n";
>      return retValue;
> }

If retValue isn't initialized then this program has undefined
behaviour as C++ so all bets are off (LLVM might be propagating an
"undef" and simply not returning a meaningful value).

Otherwise we need more detail. I'd expect this to work on all targets
(int64_t would in almost every case map to i64, and this straight
return should be fine, particularly if it comes from C++). So are you
using a custom target and does it have any quirks that might be
relevant? The key functions to look at would be LowerCall and
LowerReturn in XYZISelLowering.cpp.



More information about the llvm-dev mailing list