[llvm] [X86][GlobalIsel] support G_FABS for f80 (PR #136718)
via llvm-commits
llvm-commits at lists.llvm.org
Tue May 27 00:52:24 PDT 2025
mahesh-attarde wrote:
> I am working on i686 test. There seems to be something off. I am collecting information on it.
>
> ```
> bb.0 (%ir-block.0):
> renamable $eax = MOV32ri 2147483647
> renamable $eax = AND32rm killed renamable $eax(tied-def 0), %fixed-stack.0, 1, $noreg, 0, $noreg, implicit-def dead $eflags :: (invariant load (s32) from %fixed-stack.0)
> $fp0 = COPY killed renamable $eax
> RET 0, implicit killed $fp0
> ```
>
> This code results, This is part of lowerReturn in GISEL. I suspect fp0 should not even be created. Let me know if I am wrong.
>
> ```
> llc: /llvm-project/llvm/lib/Target/X86/X86FloatingPoint.cpp:317: unsigned int getFPReg(const llvm::MachineOperand&): Assertion `Reg >= X86::FP0 && Reg <= X86::FP6 && "Expected FP register!"' failed.
> ```
It turns out Fp0 here is because of C calling convention with X87 enabled. we have defined it in calling covn td file. We might be missing RET register handling since we only look for ret reg as EAX or RAX in lowerReturn.
https://github.com/llvm/llvm-project/pull/136718
More information about the llvm-commits
mailing list