[all-commits] [llvm/llvm-project] a41226: [ValueTracking] Fix KnownBits conflict for calls (...

Björn Pettersson via All-commits all-commits at lists.llvm.org
Thu Mar 7 12:33:12 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a41226b05510a6f40d99fc622d78853460dc5599
      https://github.com/llvm/llvm-project/commit/a41226b05510a6f40d99fc622d78853460dc5599
  Author: Björn Pettersson <bjorn.a.pettersson at ericsson.com>
  Date:   2024-03-07 (Thu, 07 Mar 2024)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/unittests/Analysis/ValueTrackingTest.cpp

  Log Message:
  -----------
  [ValueTracking] Fix KnownBits conflict for calls (range vs returned) (#84353)

If a function only exits for certain input values we can still derive
that an argument is "returned". We can also derive range metadata that
describe the possible value range returned by the function. However, it
turns out that those two analyses can result in conflicting information.

Example:
  declare i16 @foo(i16 returned)
  ...
  %A = call i16 @foo(i16 4095), !range !{i16 32, i16 33}

To avoid "Bits known to be one AND zero?" assertion failures we know
make sure to discard the known bits for this kind of scenario.



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