[all-commits] [llvm/llvm-project] 55a338: [X86] Add DAG combine to fold promoted f32 sequenc...

Tharun V K via All-commits all-commits at lists.llvm.org
Tue Apr 7 02:11:25 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 55a3382be485148a3ab29c8942a07f13e9ba036a
      https://github.com/llvm/llvm-project/commit/55a3382be485148a3ab29c8942a07f13e9ba036a
  Author: Tharun V K <40231849+tharunvk at users.noreply.github.com>
  Date:   2026-04-07 (Tue, 07 Apr 2026)

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

  Log Message:
  -----------
  [X86] Add DAG combine to fold promoted f32 sequences for f16 fneg and fabs (#189395)

This patch optimizes f16 fneg and fabs on X86 targets by introducing 
a DAG combine to identify and collapse fpext -> fneg/fabs -> fptrunc.

Generally f16 operations are promoted to f32. For bitwise-equivalent 
operations like fneg and fabs, this results in unnecessary and 
expensive f32 library calls (__extendhfsf2 / __truncsfhf2) or 
hardware conversions (vcvtph2ps / vcvtps2ph) at -O0.

Fixes: https://github.com/llvm/llvm-project/issues/188201

---------

Co-authored-by: Phoebe Wang <phoebe.wang at intel.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list