[all-commits] [llvm/llvm-project] 7de649: [DAG] shouldReduceLoadWidth - hasOneUse should che...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Mon Feb 24 03:10:03 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7de64925da9f09d1a66230c5e118fe127a6c49e3
      https://github.com/llvm/llvm-project/commit/7de64925da9f09d1a66230c5e118fe127a6c49e3
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2025-02-24 (Mon, 24 Feb 2025)

  Changed paths:
    M llvm/include/llvm/CodeGen/SelectionDAGNodes.h
    M llvm/include/llvm/CodeGen/TargetLowering.h
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/AArch64/merge-store.ll
    M llvm/test/CodeGen/AArch64/sme-framelower-use-bp.ll
    M llvm/test/CodeGen/AArch64/sve-fixed-length-extract-subvector.ll
    M llvm/test/CodeGen/AMDGPU/kernel-argument-dag-lowering.ll
    M llvm/test/CodeGen/ARM/vpadd.ll
    M llvm/test/CodeGen/RISCV/rvv/extractelt-fp.ll
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-extract-subvector.ll

  Log Message:
  -----------
  [DAG] shouldReduceLoadWidth - hasOneUse should check just the loaded value - not the chain (#128167)

The hasOneUse check was failing in any case where the load was part of a chain - we should only be checking if the loaded value has one use, and any updates to the chain should be handled by the fold calling shouldReduceLoadWidth.

I've updated the x86 implementation to match, although it has no effect here yet (I'm still looking at how to improve the x86 implementation) as the inner for loop was discarding chain uses anyway.

By using SDValue::hasOneUse instead this patch exposes a missing dependency on the LLVMSelectionDAG library in a lot of tools + unittests, which resulted in having to make SDNode::hasNUsesOfValue inline.

Noticed while fighting the x86 regressions in #122671



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