[all-commits] [llvm/llvm-project] 97fd08: [GlobalISel] avoid G_TRUNC with floating-point G_M...

Kacper Doga via All-commits all-commits at lists.llvm.org
Mon Aug 3 05:24:39 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 97fd08dbaf82b35ef860bca11bb047fd60f723d5
      https://github.com/llvm/llvm-project/commit/97fd08dbaf82b35ef860bca11bb047fd60f723d5
  Author: Kacper Doga <kacper.doga at intel.com>
  Date:   2026-08-03 (Mon, 03 Aug 2026)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
    A llvm/test/CodeGen/AArch64/GlobalISel/legalize-trunc-merge-float-src.mir

  Log Message:
  -----------
  [GlobalISel] avoid G_TRUNC with floating-point G_MERGE_VALUES source (#206733)

With extended LLT, scalar LLT carry an integer/float kind information.
The `G_TRUNC(G_MERGE_VALUES)` fold in
`LegalizationArtifactCombiner::tryCombineTrunc` truncated, copied or
rebuilt a merge directly from the merge's source register.

**Problem**
When those sources are floating-point this produces artifacts with float
source operand - e.g. `i1 = G_TRUNC f32` or a rebuilt `iN =
G_MERGE_VALUES f32, ...` which are bit level integer operations and must
not take a float operand.

**Fix**
Reinterpret a floating-point merge source to an integer of the same size
via `G_BITCAST` before truncating, copying or rebuilding the merge. So
the emitted artifacts stay on integer operands. Non-float sources and
non-extended-LLT builds are unaffected.



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