[JumpThreading] Conditionally freeze its condition when unfolding select
authorJuneyoung Lee <aqjune@gmail.com>
Thu, 10 Sep 2020 06:49:04 +0000 (15:49 +0900)
committerJuneyoung Lee <aqjune@gmail.com>
Thu, 10 Sep 2020 06:49:40 +0000 (15:49 +0900)
commit39c1653b3dbb7d1c439a3e8cf31d1aa159a4afc5
treed22c2c798a0bacb40cfdcb02eccd54f1e98d35a7
parentcde8fc65aeedda5e7cfc66d5c06a74399a80fffa
[JumpThreading] Conditionally freeze its condition when unfolding select

This patch fixes pr45956 (https://bugs.llvm.org/show_bug.cgi?id=45956 ).
To minimize its impact to the quality of generated code, I suggest enabling
this only for LTO as a start (it has two JumpThreading passes registered).
This patch contains a flag that makes JumpThreading enable it.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D84940
llvm/include/llvm/Transforms/Scalar.h
llvm/include/llvm/Transforms/Scalar/JumpThreading.h
llvm/lib/Transforms/Scalar/JumpThreading.cpp
llvm/test/Transforms/JumpThreading/select-unfold-freeze.ll [new file with mode: 0644]