[GVN LoadPRE] Add an option to disable splitting backedge
authorSerguei Katkov <serguei.katkov@azul.com>
Tue, 20 Oct 2020 10:32:08 +0000 (17:32 +0700)
committerSerguei Katkov <serguei.katkov@azul.com>
Tue, 27 Oct 2020 04:59:52 +0000 (11:59 +0700)
commitb69919b537fffcc5b6aaa6d78e2c039725a81f5b
treec868dfe723260e18e6c6289424dcbcba157d63bc
parentc6ca26c0bfedb8f80d6f8cb9adde25b1d6aac1c5
[GVN LoadPRE] Add an option to disable splitting backedge

GVN Load PRE can split the backedge causing breaking the loop structure where the latch
contains the conditional branch with for example induction variable.

Different optimizations expect this form of the loop, so it is better to preserve it for some time.
This CL adds an option to control an ability to split backedge.

Default value is true so technically it is NFC and current behavior is not changed.

Reviewers: fedor.sergeev, mkazantsev, nikic, reames, fhahn
Reviewed By: mkazasntsev
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D89854
llvm/include/llvm/Transforms/Scalar/GVN.h
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Transforms/Scalar/GVN.cpp
llvm/test/Transforms/GVN/PRE/load-pre-split-backedge.ll [new file with mode: 0644]