[all-commits] [llvm/llvm-project] f270a4: [AArch64] Don't tail call memset if it would conve...

Amara Emerson via All-commits all-commits at lists.llvm.org
Wed Jul 17 01:32:13 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f270a4dd6667759d7305797a077ae09648318ac7
      https://github.com/llvm/llvm-project/commit/f270a4dd6667759d7305797a077ae09648318ac7
  Author: Amara Emerson <amara at apple.com>
  Date:   2024-07-17 (Wed, 17 Jul 2024)

  Changed paths:
    M llvm/include/llvm/CodeGen/Analysis.h
    M llvm/include/llvm/CodeGen/SelectionDAG.h
    M llvm/lib/CodeGen/Analysis.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AMDGPU/SIISelLowering.cpp
    M llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
    M llvm/lib/Target/Lanai/LanaiISelLowering.cpp
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
    M llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
    M llvm/lib/Target/Mips/MipsISelLowering.cpp
    M llvm/lib/Target/PowerPC/PPCISelLowering.cpp
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/lib/Target/Sparc/SparcISelLowering.cpp
    M llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Target/X86/X86ISelLoweringCall.cpp
    M llvm/lib/Target/X86/X86SelectionDAGInfo.cpp
    M llvm/lib/Target/XCore/XCoreISelLowering.cpp
    A llvm/test/CodeGen/AArch64/no-tail-call-bzero-from-memset.ll

  Log Message:
  -----------
  [AArch64] Don't tail call memset if it would convert to a bzero. (#98969)

Well, not quite that simple. We can tc memset since it returns the first
argument but bzero doesn't do that and therefore we can end up
miscompiling.

This patch also refactors the logic out of isInTailCallPosition() into the callers.
As a result memcpy and memmove are also modified to do the same thing
for consistency.

rdar://131419786



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