[all-commits] [llvm/llvm-project] 6c535f: [X86][FP16] Fix crash when lowering copysign for f16

Phoebe Wang via All-commits all-commits at lists.llvm.org
Thu Jul 7 19:17:48 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6c535f9f1bf8b9516f21353853fc3b6a33c932c6
      https://github.com/llvm/llvm-project/commit/6c535f9f1bf8b9516f21353853fc3b6a33c932c6
  Author: Phoebe Wang <phoebe.wang at intel.com>
  Date:   2022-07-07 (Thu, 07 Jul 2022)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/half.ll

  Log Message:
  -----------
  [X86][FP16] Fix crash when lowering copysign for f16

This is to address the assertion fail reported in https://reviews.llvm.org/D107082#3635612
Not sure if it is a problem of promoting FCOPYSIGN + libcall FP_ROUND.
The promoting will set the rounding mode to 1 https://github.com/llvm/llvm-project/blob/a442c628882eb07fffff8c9f7c87a317af14555a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp#L4810-L4814
While libcall cannot handle the rounding mode equals to 1 https://github.com/llvm/llvm-project/blob/a442c628882eb07fffff8c9f7c87a317af14555a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp#L4324-L4328
So changing the action to Expand to workaround the problem.

Reviewed By: clementval, MaskRay

Differential Revision: https://reviews.llvm.org/D129294




More information about the All-commits mailing list