[all-commits] [llvm/llvm-project] cb8d83: [InstCombine] Fix assertion failure in issue80597 ...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Mon Feb 5 09:29:51 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cb8d83a77c25e529f58eba17bb1ec76069a04e90
      https://github.com/llvm/llvm-project/commit/cb8d83a77c25e529f58eba17bb1ec76069a04e90
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2024-02-06 (Tue, 06 Feb 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
    A llvm/test/Transforms/InstCombine/pr80597.ll

  Log Message:
  -----------
  [InstCombine] Fix assertion failure in issue80597 (#80614)

The assertion in #80597 failed when we were trying to compute known bits
of a value in an unreachable BB.

https://github.com/llvm/llvm-project/blob/859b09da08c2a47026ba0a7d2f21b7dca705864d/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp#L749-L810

In this case, `SignBits` is 30 (deduced from instr info), but `Known` is
`10000101010111010011110101000?0?00000000000000000000000000000000`
(deduced from dom cond). Setting high bits of `lshr Known, 1` will lead
to conflict.

This patch masks out high bits of `Known.Zero` to address this problem.

Fixes #80597.




More information about the All-commits mailing list