diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-06-12 14:05:58 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-06-12 14:05:58 +0000 |
commit | aa6bdf9dcd5f0c82e58e9ba1f25779a5f00ab923 (patch) | |
tree | c98e6ebd6426c4b69fe6638ae4532362b504f098 /llvm/lib/Transforms/Utils/LoopVersioning.cpp | |
parent | 339b39b7733726634520573c06459de842a7ac64 (diff) | |
download | llvm-aa6bdf9dcd5f0c82e58e9ba1f25779a5f00ab923.zip llvm-aa6bdf9dcd5f0c82e58e9ba1f25779a5f00ab923.tar.gz llvm-aa6bdf9dcd5f0c82e58e9ba1f25779a5f00ab923.tar.bz2 |
LoopVersioning: Respect convergent
This changes the standalone pass only. Arguably the utility class
itself should assert there are no convergent calls. However, a target
pass with additional context may still be able to version a loop if
all of the dynamic conditions are sufficiently uniform.
llvm-svn: 363165
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopVersioning.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopVersioning.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopVersioning.cpp b/llvm/lib/Transforms/Utils/LoopVersioning.cpp index d59076c..a9a480a 100644 --- a/llvm/lib/Transforms/Utils/LoopVersioning.cpp +++ b/llvm/lib/Transforms/Utils/LoopVersioning.cpp @@ -280,8 +280,9 @@ public: bool Changed = false; for (Loop *L : Worklist) { const LoopAccessInfo &LAI = LAA->getInfo(L); - if (L->isLoopSimplifyForm() && (LAI.getNumRuntimePointerChecks() || - !LAI.getPSE().getUnionPredicate().isAlwaysTrue())) { + if (L->isLoopSimplifyForm() && !LAI.hasConvergentOp() && + (LAI.getNumRuntimePointerChecks() || + !LAI.getPSE().getUnionPredicate().isAlwaysTrue())) { LoopVersioning LVer(LAI, L, LI, DT, SE); LVer.versionLoop(); LVer.annotateLoopWithNoAlias(); |