[DFAJumpThreading] Determinator BB should precede switch-defining BB
authorAlexey Zhikhartsev <alex.zhi@huawei.com>
Wed, 15 Dec 2021 17:14:13 +0000 (12:14 -0500)
committerAlex Zhikhartsev <alex.zhi@huawei.com>
Fri, 24 Dec 2021 15:27:03 +0000 (10:27 -0500)
commitd5dc3964a7417a34fe581d93ff9642923f8a634d
treeb415527d8e35481f55bcc0359b1dba470f3d439e
parent8020458c5dc2be841c07d26ff75b5471314e6631
[DFAJumpThreading] Determinator BB should precede switch-defining BB

Otherwise, it is possible that the state defined in the determinator
block defines the state for the next iteration of the loop, rather than
for the current one.

Fixes llvm-test-suite's
SingleSource/Regression/C/gcc-c-torture/execute/pr80421.c

Differential Revision: https://reviews.llvm.org/D115832
llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp
llvm/test/Transforms/DFAJumpThreading/dfa-jump-threading-analysis.ll