[all-commits] [llvm/llvm-project] 7c73c2: [LoopDeletion] Benefit from branches by undef cond...
Max Kazantsev via All-commits
all-commits at lists.llvm.org
Sun Jun 27 21:40:55 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7c73c2ede8088802adb8191d05cad09e3ad88539
https://github.com/llvm/llvm-project/commit/7c73c2ede8088802adb8191d05cad09e3ad88539
Author: Max Kazantsev <mkazantsev at azul.com>
Date: 2021-06-28 (Mon, 28 Jun 2021)
Changed paths:
M llvm/lib/Transforms/Scalar/LoopDeletion.cpp
M llvm/test/Transforms/LoopDeletion/eval_first_iteration.ll
Log Message:
-----------
[LoopDeletion] Benefit from branches by undef conditions when symbolically executing 1st iteration
We can exploit branches by `undef` condition. Frankly, the LangRef says that
such branches are UB, so we can assume that all outgoing edges of such blocks
are dead.
However, from practical perspective, we know that this is not supported correctly
in some other places. So we are being conservative about it.
Branch by undef is treated in the following way:
- If it is a loop-exiting branch, we always assume it exits the loop;
- If not, we arbitrarily assume it takes `true` value.
Differential Revision: https://reviews.llvm.org/D104689
Reviewed By: nikic
More information about the All-commits
mailing list