[all-commits] [llvm/llvm-project] 73e22f: [Reassociate] Preserve NSW flags after expr tree r...

Akshay Deodhar via All-commits all-commits at lists.llvm.org
Tue May 28 11:06:00 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 73e22ff3d77db72bb9b6e22342417a5f4fe6afb4
      https://github.com/llvm/llvm-project/commit/73e22ff3d77db72bb9b6e22342417a5f4fe6afb4
  Author: Akshay Deodhar <adeodhar at nvidia.com>
  Date:   2024-05-28 (Tue, 28 May 2024)

  Changed paths:
    M llvm/include/llvm/Transforms/Scalar/Reassociate.h
    M llvm/lib/Transforms/Scalar/Reassociate.cpp
    M llvm/test/Transforms/Reassociate/local-cse.ll
    A llvm/test/Transforms/Reassociate/reassoc-add-nsw.ll

  Log Message:
  -----------
  [Reassociate] Preserve NSW flags after expr tree rewriting (#93105)

We can guarantee NSW on all operands in a reassociated add expression
tree when:

- All adds in an add operator tree are NSW, AND either 
  - All add operands are guaranteed to be nonnegative, OR 
  - All adds are also NUW

- Alive2: 
- Nonnegative Operands
	- 3 operands: https://alive2.llvm.org/ce/z/G4XW6Q
	- 4 operands: https://alive2.llvm.org/ce/z/FWcZ6D
 - NUW NSW adds: https://alive2.llvm.org/ce/z/vRUxeC

---------

Co-authored-by: Nikita Popov <github at npopov.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