[PATCH] D60846: [ValueTracking] Improve isKnowNonZero for Ints

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 05:57:20 PDT 2019


uabelho added a comment.

Hi,

I'm experiencing problems with this patch as well. I'm not 100% sure what the
problem is yet but I have a suspicion:

The comment for isKnownNonZero says:

/// Return true if the given value is known to be non-zero when defined.
[...]
/// For pointers, if the context instruction and dominator tree are
/// specified, perform context-sensitive analysis and return true if the
/// pointer couldn't possibly be null at the specified instruction.

The context-sensitive analysis is done by isKnownNonZeroFromDominatingCondition()
but since we now allow that to return true for non-pointers as well, we suddenly
can return true from isKnownNonZero() based on a context-sensitive analysis. Or?

And perhaps the users of isKnownNonZero() then assumes that
 "Return true if the given value is known to be non-zero when defined."
still holds for non-pointers?

The problem I'm seeing is a miscompile for my out-of-tree target so it's quite nasty.
I'll try to reduce and come up with an x86 example.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60846/new/

https://reviews.llvm.org/D60846





More information about the llvm-commits mailing list