OSDN Git Service

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)
commitb2f54ba7d597a924015505de002e87aefe426839
treedcb9aa3247a5c3c76bead92d362565c6b054a6de
parentf19a9097c6a6b5b1279bfbe433742cae9c8997c4
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360671 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/IVDescriptors.h
lib/Analysis/IVDescriptors.cpp
unittests/Analysis/CMakeLists.txt
unittests/Analysis/IVDescriptorsTest.cpp [new file with mode: 0644]