aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopVersioning.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-03-25 23:35:19 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-04-30 23:12:54 +0200
commitb74c6d2c9d8e57db96742094cc4daf98a258b412 (patch)
treebe399a22279a98e7b90875ff956c97820b16e42e /llvm/lib/Transforms/Utils/LoopVersioning.cpp
parentc67134515301f9fb325dd0d82cf90044deee9cc1 (diff)
downloadllvm-b74c6d2c9d8e57db96742094cc4daf98a258b412.zip
llvm-b74c6d2c9d8e57db96742094cc4daf98a258b412.tar.gz
llvm-b74c6d2c9d8e57db96742094cc4daf98a258b412.tar.bz2
[InlineFunction] Disable emission of alignment assumptions by default
In D74183 clang started emitting alignment for sret parameters unconditionally. This caused a 1.5% compile-time regression on tramp3d-v4. The reason is that we now generate many instance of IR like %ptrint = ptrtoint %class.GuardLayers* %guards_m to i64 %maskedptr = and i64 %ptrint, 3 %maskcond = icmp eq i64 %maskedptr, 0 tail call void @llvm.assume(i1 %maskcond) to preserve the alignment information during inlining. Based on IR analysis, these assumptions also regress optimization. The attached phase ordering test case illustrates two issues: One are instruction count based optimization heuristics, which are affected by the four additional instructions of the assumption. The other is blocking of SROA due to ptrtoint casts (PR45763). We already encountered the same problem in Rust, where we (unlike Clang) generally prefer to emit alignment information absolutely everywhere it is available. We were only able to do this after hardcoding -preserve-alignment-assumptions-during-inlining=false, because we were seeing significant optimization and compile-time regressions otherwise. This patch disables -preserve-alignment-assumptions-during-inlining by default, because we should not be punishing people for adding more alignment annotations. Once the assume bundle work shakes out and we can represent (and use) alignment assumptions using assume bundles, it should be possible to re-enable this with reduced overhead. Differential Revision: https://reviews.llvm.org/D76886
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopVersioning.cpp')
0 files changed, 0 insertions, 0 deletions