[LV] Fix predication for branches with matching true and false succs.
authorFlorian Hahn <flo@fhahn.com>
Thu, 23 Jan 2020 02:30:33 +0000 (18:30 -0800)
committerFlorian Hahn <flo@fhahn.com>
Thu, 23 Jan 2020 02:34:11 +0000 (18:34 -0800)
commitf14f2a856802e086662d919e2ead641718b27555
tree7eb088f7c68091daa7d91fc880c2ffc2ba45f157
parentddfe8751b16a1d57b0586fb48d1109c98234bc3f
[LV] Fix predication for branches with matching true and false succs.

Currently due to the edge caching, we create wrong predicates for
branches with matching true and false successors. We will cache the
condition for the edge from the true successor, and then lookup the same
edge (src and dst are the same) for the edge to the false successor.

If both successors match, the condition should always be true. At the
moment, we cannot really create constant VPValues, but we can just
create a true condition as X | !X. Later passes will clean that up.

Fixes PR44488.

Reviewers: rengolin, hsaito, fhahn, Ayal, dorit, gilr

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D73079
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/pr44488-predication.ll [new file with mode: 0644]