aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Tooling/Syntax/TreeTest.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2020-04-07 13:43:48 +0100
committerFlorian Hahn <flo@fhahn.com>2020-04-07 14:01:55 +0100
commit338be9c59527c3d172f64e8861bcbb472297d52d (patch)
treef2c9ed1e3f8a5c8463b01f9ad926c780dc06d38c /clang/unittests/Tooling/Syntax/TreeTest.cpp
parentec0b9908952a9f4a19c3eb92ba0fc01cffcb8614 (diff)
downloadllvm-338be9c59527c3d172f64e8861bcbb472297d52d.zip
llvm-338be9c59527c3d172f64e8861bcbb472297d52d.tar.gz
llvm-338be9c59527c3d172f64e8861bcbb472297d52d.tar.bz2
[Clang] Add llvm.loop.unroll.disable to loops with -fno-unroll-loops.
Currently Clang does not respect -fno-unroll-loops during LTO. During D76916 it was suggested to respect -fno-unroll-loops on a TU basis. This patch uses the existing llvm.loop.unroll.disable metadata to disable loop unrolling explicitly for each loop in the TU if unrolling is disabled. This should ensure that loops from TUs compiled with -fno-unroll-loops are skipped by the unroller during LTO. This also means that if a loop from a TU with -fno-unroll-loops gets inlined into a TU without this option, the loop won't be unrolled. Due to the fact that some transforms might drop loop metadata, there potentially are cases in which we still unroll loops from TUs with -fno-unroll-loops. I think we should fix those issues rather than introducing a function attribute to disable loop unrolling during LTO. Improving the metadata handling will benefit other use cases, like various loop pragmas, too. And it is an improvement to clang completely ignoring -fno-unroll-loops during LTO. If that direction looks good, we can use a similar approach to also respect -fno-vectorize during LTO, at least for LoopVectorize. In the future, this might also allow us to remove the UnrollLoops option LLVM's PassManagerBuilder. Reviewers: Meinersbur, hfinkel, dexonsmith, tejohnson Reviewed By: Meinersbur, tejohnson Differential Revision: https://reviews.llvm.org/D77058
Diffstat (limited to 'clang/unittests/Tooling/Syntax/TreeTest.cpp')
0 files changed, 0 insertions, 0 deletions