diff options
| author | Tobias Grosser <tobias@grosser.es> | 2017-09-25 20:27:15 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2017-09-25 20:27:15 +0000 |
| commit | 5e531dfef41bb7cf451481e01552a31c598fdeac (patch) | |
| tree | a74a434965a2f6d882c9600bdf0d1eef03c657e9 /polly/lib/Analysis/ScopDetection.cpp | |
| parent | 01414bdc2c23f24e255d4b068f90938035f1149a (diff) | |
| download | bcm5719-llvm-5e531dfef41bb7cf451481e01552a31c598fdeac.tar.gz bcm5719-llvm-5e531dfef41bb7cf451481e01552a31c598fdeac.zip | |
[ScopInfo] Allow invariant loads in branch conditions
In case the value used in a branch condition is a load instruction, assume this
load to be invariant.
llvm-svn: 314146
Diffstat (limited to 'polly/lib/Analysis/ScopDetection.cpp')
| -rw-r--r-- | polly/lib/Analysis/ScopDetection.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index df3acd15e06..38b7be1d1b0 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -595,6 +595,12 @@ bool ScopDetection::isValidBranch(BasicBlock &BB, BranchInst *BI, return true; } + if (auto Load = dyn_cast<LoadInst>(Condition)) + if (!IsLoopBranch) { + Context.RequiredILS.insert(Load); + return true; + } + // Non constant conditions of branches need to be ICmpInst. if (!isa<ICmpInst>(Condition)) { if (!IsLoopBranch && AllowNonAffineSubRegions && |

