[all-commits] [llvm/llvm-project] 121cd7: Re apply 130577 narrow math for and operand (#133896)

Shoreshen via All-commits all-commits at lists.llvm.org
Thu Apr 17 02:06:00 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 121cd7c6f0270540ce976b98061ba765edc1675d
      https://github.com/llvm/llvm-project/commit/121cd7c6f0270540ce976b98061ba765edc1675d
  Author: Shoreshen <372660931 at qq.com>
  Date:   2025-04-17 (Thu, 17 Apr 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
    M llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-mul24.ll
    M llvm/test/CodeGen/AMDGPU/atomic_optimizations_global_pointer.ll
    M llvm/test/CodeGen/AMDGPU/memcpy-crash-issue63986.ll
    A llvm/test/CodeGen/AMDGPU/narrow_math_for_and.ll
    M llvm/test/CodeGen/AMDGPU/widen-smrd-loads.ll

  Log Message:
  -----------
  Re apply 130577 narrow math for and operand (#133896)

Re-apply https://github.com/llvm/llvm-project/pull/130577

Which is reverted in https://github.com/llvm/llvm-project/pull/133880

The old application failed in address sanitizer due to
`tryNarrowMathIfNoOverflow` was called after `I.eraseFromParent();` in
`AMDGPUCodeGenPrepareImpl::visitBinaryOperator`, it create a use after
free failure.

To fix this, `tryNarrowMathIfNoOverflow` will be called before and
directly return if `tryNarrowMathIfNoOverflow` result in true.



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