[all-commits] [llvm/llvm-project] 1c298c: [InstCombine] Preserve nuw flags when merging geps

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Sep 13 02:15:47 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1c298c927498983dee29037ed1d3e71b72ca0082
      https://github.com/llvm/llvm-project/commit/1c298c927498983dee29037ed1d3e71b72ca0082
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-09-13 (Fri, 13 Sep 2024)

  Changed paths:
    M clang/test/CodeGen/attr-counted-by.c
    M clang/test/OpenMP/bug57757.cpp
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/InstCombine/getelementptr.ll

  Log Message:
  -----------
  [InstCombine] Preserve nuw flags when merging geps

These transforms all perform a variant of (gep (gep p, x), y)
to (gep p, (x + y)). We can preserve both inbounds and nuw
during such transforms (https://alive2.llvm.org/ce/z/Stu4cN), but
not nusw, which would require proving that the new add is nsw.

For the constant offset case, I've conservatively retained the
logic that checks for negative intermediate offsets, though I'm
not sure it's still reachable nowadays.



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