llvm-project/llvm/test/Transforms/DFAJumpThreading
Alex Zhikhartsev 8b0d763474 [DFAJumpThreading] Relax analysis to handle unpredictable initial values
Responding to a feature request from the Rust community:

https://github.com/rust-lang/rust/issues/80630

    void foo(X) {
      for (...)
	switch (X)
	  case A
	    X = B
	  case B
	    X = C
    }

Even though the initial switch value is non-constant, the switch
statement can still be threaded: the initial value will hit the switch
statement but the rest of the state changes will proceed by jumping
unconditionally.

The early predictability check is relaxed to allow unpredictable values
anywhere, but later, after the paths through the switch statement have
been enumerated, no non-constant state values are allowed along the
paths. Any state value not along a path will be an initial switch value,
which can be safely ignored.

Differential Revision: https://reviews.llvm.org/D124394
2022-05-26 11:29:54 -04:00
..
dfa-constant-propagation.ll
dfa-jump-threading-analysis.ll [DFAJumpThreading] Relax analysis to handle unpredictable initial values 2022-05-26 11:29:54 -04:00
dfa-jump-threading-transform.ll
dfa-unfold-select.ll
max-path-length.ll
negative.ll [DFAJumpThreading] Relax analysis to handle unpredictable initial values 2022-05-26 11:29:54 -04:00