Save the induction binary operator in IVDescriptors for non FP induction variables.
authorKit Barton <kbarton@ca.ibm.com>
Tue, 14 May 2019 13:26:36 +0000 (13:26 +0000)
committerKit Barton <kbarton@ca.ibm.com>
Tue, 14 May 2019 13:26:36 +0000 (13:26 +0000)
commit37b7922daa924d7e50aa95ea01fa2d90ef310975
treeacc631d48090259c3b122c3f2c7b1217634a145c
parent717b62a146ae7ea106c520144a20db1aad9d53bb
Save the induction binary operator in IVDescriptors for non FP induction variables.

Summary:
Currently InductionBinOps are only saved for FP induction variables, the PR extends it with non FP induction variable, so user of IVDescriptors can query the InductionBinOps for integer induction variables.

The changes in hasUnsafeAlgebra() and getUnsafeAlgebraInst() are required for the existing LIT test cases to pass. As described in the comment of the two functions, one of the requirement to return true is it is a FP induction variable. The checks was not needed because InductionBinOp was not set on non FP cases before.

https://reviews.llvm.org/D60565 depends on the patch.

Committed on behalf of @Whitney (Whitney Tsang).

Reviewers: jdoerfert, kbarton, fhahn, hfinkel, dmgreen, Meinersbur

Reviewed By: jdoerfert

Subscribers: mgorny, hiraditya, jsji, llvm-commits

Tags: #llvm

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

llvm-svn: 360671
llvm/include/llvm/Analysis/IVDescriptors.h
llvm/lib/Analysis/IVDescriptors.cpp
llvm/unittests/Analysis/CMakeLists.txt
llvm/unittests/Analysis/IVDescriptorsTest.cpp [new file with mode: 0644]