Skip to content
Commit cfdc9671 authored by Kazu Hirata's avatar Kazu Hirata
Browse files

[Instcombine] Fix uses of undef (PR46940)

Without this patch, we attempt to distribute And over Xor even in
unsafe circumstances like so:

  undef & (true ^ true)  ==>  (undef & true) ^ (undef & true)

and evaluate it to undef instead of false.  Note that "true ^ true"
may show up implicitly with one true being part of a PHI node.

This patch fixes the problem by teaching SimplifyUsingDistributiveLaws
to not use undef as part of simplifications.

Reviewers: spatel, aqjune, nikic, lebedev.ri, fhahn, jdoerfert

Differential Revision: https://reviews.llvm.org/D85687
parent 29429d1a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment