aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2021-02-01 08:51:22 +0000
committerFlorian Hahn <flo@fhahn.com>2021-02-01 09:03:30 +0000
commitb8c81fa5c7f77a7a1267e42ddbbc9bffb10b0817 (patch)
tree7d5ebb243192133bc4c1dda95ddfd974333ac465 /clang/lib/Frontend/CompilerInvocation.cpp
parent80cdd30eb90c3509bf315f1fa1369483e2448bbd (diff)
downloadllvm-b8c81fa5c7f77a7a1267e42ddbbc9bffb10b0817.zip
llvm-b8c81fa5c7f77a7a1267e42ddbbc9bffb10b0817.tar.gz
llvm-b8c81fa5c7f77a7a1267e42ddbbc9bffb10b0817.tar.bz2
[LoopUnswitch] Add shortcut if unswitched path is a no-op.
If we determine that the invariant path through the loop has no effects, we can directly branch to the exit block, instead to unswitching first. Besides avoiding some extra work (unswitching first, then deleting the loop again) this allows to be more aggressive than regular unswitching with respect to cost-modeling. This approach should always be be desirable. This is similar in spirit to D93734, just that it uses the previously added checks for loop-unswitching. I tried to add the required no-op checks from scratch, as we only check a subset of the loop. There is potential to unify the checks with LoopDeletion, at the cost of adding a predicate whether a block should be considered. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D95468
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions