[all-commits] [llvm/llvm-project] e6375c: [InstCombine] Fix potentially buggy code in `((%x ...

goldsteinn via All-commits all-commits at lists.llvm.org
Mon Jan 9 02:44:28 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e6375ca6dc5ba263ad3d9b6d779c5cf5b0f2e9ba
      https://github.com/llvm/llvm-project/commit/e6375ca6dc5ba263ad3d9b6d779c5cf5b0f2e9ba
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-01-09 (Mon, 09 Jan 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

  Log Message:
  -----------
  [InstCombine] Fix potentially buggy code in `((%x & C) == 0) --> %x u< (-C)` transform

While demanded bits constant shrinking appears to prevent this in
practice right now, it is principally possible for C2 to have
set bits that are known not-needed (zeroable). See: D140858

`+` will overflow here, `|` will get the right logic.

Differential Revision: https://reviews.llvm.org/D141089




More information about the All-commits mailing list