[llvm] [X86] Combine FRINT + FP_TO_SINT to LRINT (PR #126477)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 22 04:14:00 PST 2025


phoebewang wrote:

> I'm seeing a crash on x86 windows due to one of the commits in [08c69b2...af64f0a](https://github.com/llvm/llvm-project/compare/08c69b2ef6eeba19956ad24fb7e9d29e9778cbaa...af64f0a6c2e26b3fd1979c1fa380136e5528c9b3), I suspect it's this one. Let me know if you need a reproducer or any other info and I'll see what I can do.
> 
> ```
> LLVM ERROR: Cannot select: t58: i32 = lrint t9, float.jl:420 @[ float.jl:996 @[ number.jl:7 @[ rounding.jl:480 @[ rounding.jl:479 @[ rounding.jl:477 @[ twiceprecision.jl:409 ] ] ] ] ] ]
>   t9: f16,ch = CopyFromReg t0, Register:f16 %39, float.jl:469 @[ rounding.jl:479 @[ rounding.jl:477 @[ twiceprecision.jl:409 ] ] ]
>     t8: f16 = Register %39
> In function: julia_Colon_113403
> 
> [5492] signal 22: SIGABRT
> in expression starting at none:0
> crt_sig_handler at D:/a/llvm_julia_tester/llvm_julia_tester/julia/src\signals-win.c:104
> raise at C:\Windows\System32\msvcrt.dll (unknown line)
> abort at C:\Windows\System32\msvcrt.dll (unknown line)
> _ZN4llvm18report_fatal_errorERKNS_5TwineEb at D:\a\llvm_julia_tester\llvm_julia_tester\julia\usr\bin\libLLVM-21jl.dll (unknown line)
> _ZN4llvm18raw_string_ostream10write_implEPKcj at D:\a\llvm_julia_tester\llvm_julia_tester\julia\usr\bin\libLLVM-21jl.dll (unknown line)
> _ZN4llvm11raw_ostream5writeEPKcj at D:\a\llvm_julia_tester\llvm_julia_tester\julia\usr\bin\libLLVM-21jl.dll (unknown line)
> _ZN4llvm16SelectionDAGISel15CannotYetSelectEPNS_6SDNodeE at D:\a\llvm_julia_tester\llvm_julia_tester\julia\usr\bin\libLLVM-21jl.dll (unknown line)
> _ZN4llvm16SelectionDAGISel16SelectCodeCommonEPNS_6SDNodeEPKhj at D:\a\llvm_julia_tester\llvm_julia_tester\julia\usr\bin\libLLVM-21jl.dll (unknown line)
> _ZNSt17_Function_handlerIFvPN4llvm6SDNodeES2_EZNS0_16SelectionDAGISel16SelectCodeCommonES2_PKhjE3$_1E9_M_invokeERKSt9_Any_dataOS2_SC_ at D:\a\llvm_julia_tester\llvm_julia_tester\julia\usr\bin\libLLVM-21jl.dll (unknown line)
> _ZNK4llvm12SelectionDAG18ComputeNumSignBitsENS_7SDValueERKNS_5APIntEj at D:\a\llvm_julia_tester\llvm_julia_tester\julia\usr\bin\libLLVM-21jl.dll (unknown line)
> _ZN4llvm9KnownBits3mulERKS0_S2_b at D:\a\llvm_julia_tester\llvm_julia_tester\julia\usr\bin\libLLVM-21jl.dll (unknown line)
> _ZNK4llvm7SDValue24getScalarValueSizeInBitsEv at D:\a\llvm_julia_tester\llvm_julia_tester\julia\usr\bin\libLLVM-21jl.dll (unknown line)
> _ZNK4llvm12SelectionDAG16computeKnownBitsENS_7SDValueERKNS_5APIntEj at D:\a\llvm_julia_tester\llvm_julia_tester\julia\usr\bin\libLLVM-21jl.dll (unknown line)
> _ZNK4llvm12SelectionDAG18ComputeNumSignBitsENS_7SDValueERKNS_5APIntEj at D:\a\llvm_julia_tester\llvm_julia_tester\julia\usr\bin\libLLVM-21jl.dll (unknown line)
> _ZN4llvm16SelectionDAGISel22ComputeLiveOutVRegInfoEv at D:\a\llvm_julia_tester\llvm_julia_tester\julia\usr\bin\libLLVM-21jl.dll (unknown line)
> _ZN4llvm12SelectionDAG24AddModifiedNodeToCSEMapsEPNS_6SDNodeE at D:\a\llvm_julia_tester\llvm_julia_tester\julia\usr\bin\libLLVM-21jl.dll (unknown line)
> ```

Oh, yes. I should have landed #127382 before landing this, or limit the type to f32/f64 instead.

https://github.com/llvm/llvm-project/pull/126477


More information about the llvm-commits mailing list