systems-nuts / unifico

Compiler and build harness for heterogeneous-ISA binaries with the same stack layout.
4 stars 1 forks source link

`long double` is not legalized #225

Open blackgeorge-boom opened 1 year ago

blackgeorge-boom commented 1 year ago
#include <stdio.h>

void simple()
{
   long double x = 2.0, y = 1.0;
   printf("%ld\n", x + y);
}

int main()
{
    simple();
    return 0;
}

The above code fails with:

(venv) 2 ❯ ~/llvm-9/toolchain/bin/llc -function-sections -data-sections -relocation-model=pic --trap-unreachable -optimize-regalloc -fast-isel=false -disable-machine-cse -disable-block-align --mc-relax-all -disable-x86-frame-obj-order -aarch64-csr-alignment=8 -disable-lsr-solver -align-bytes-to-four -reg-scavenging-slot -enable-misched=false -mattr=+disable-hoist-in-lowering,+disable-fp-imm-materialize -march=aarch64 -filetype=obj -o main_aarch64_init.o main opt.ll
llc: /home/blackgeorge/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:513: void getCopyToParts(llvm::SelectionDAG&, const llvm::SDLoc&, llvm::SDValue, llvm::SDValue*, unsigned int, llvm::MVT, const llvm::Value*, llvm::Optional<unsigned int>, llvm::ISD::NodeType): Assertion `DAG.getTargetLoweringInfo().isTypeLegal(PartVT) && "Copying to an illegal type!"' failed.
Stack dump:
0.      Program arguments: /home/blackgeorge/llvm-9/toolchain/bin/llc -function-sections -data-sections -relocation-model=pic --trap-unreachable -optimize-regalloc -fast-isel=false -disable-machine-cse -disable-block-align --mc-relax-all -disable-x86-frame-obj-order -aarch64-csr-alignment=8 -disable-lsr-solver -align-bytes-to-four -reg-scavenging-slot -enable-misched=false -mattr=+disable-hoist-in-lowering,+disable-fp-imm-materialize -march=aarch64 -filetype=obj -o main_aarch64_init.o main_opt.ll 
1.      Running pass 'Function Pass Manager' on module 'main_opt.ll'.
2.      Running pass 'AArch64 Instruction Selection' on function '@simple'
 #0 0x0000563b55e926d3 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/blackgeorge/llvm-project/llvm/lib/Support/Unix/Signals.inc:533:0
...