]> granicus.if.org Git - llvm/commit
[ValueTracking] Fix recurrence detection to check both PHI operands.
authorFlorian Hahn <flo@fhahn.com>
Fri, 16 Aug 2019 09:15:02 +0000 (09:15 +0000)
committerFlorian Hahn <flo@fhahn.com>
Fri, 16 Aug 2019 09:15:02 +0000 (09:15 +0000)
commit5d4bd49c4d4c99b033d3dabc87d0048cbd06d4ff
treeb60f5892733dcff97adb0a1fd6829b19187c8c17
parent338d0f7a28c1075442a7b4f51a68b620c85c4720
[ValueTracking] Fix recurrence detection to check both PHI operands.

Summary:
Currently we fail to compute known bits for recurrences where the
first incoming value is the start value of the recurrence.

Instead of exiting the loop when the first incoming value is not
the step of the recurrence, continue to check the second incoming
value.

The original code uses a loop to handle both cases, but incorrectly
exits instead of continuing.

Reviewers: lebedev.ri, spatel, nikic

Reviewed By: lebedev.ri

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66216

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369088 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ValueTracking.cpp
test/Transforms/InstCombine/phi-known-bits-operand-order.ll