llvm-project/llvm/test/Transforms/CorrelatedValuePropagation
Dmitry Vassiliev 90a3b31091 [Transforms] Enhance CorrelatedValuePropagation to handle both values of select
The "Correlated Value Propagation" pass was missing a case when handling select instructions. It was only handling the "false" constant value, while in NVPTX the select may have the condition (and thus the branches) inverted, for example:
```
loop:
	%phi = phi i32* [ %sel, %loop ], [ %x, %entry ]
	%f = tail call i32* @f(i32* %phi)
	%cmp1 = icmp ne i32* %f, %y
	%sel = select i1 %cmp1, i32* %f, i32* null
	%cmp2 = icmp eq i32* %sel, null
	br i1 %cmp2, label %return, label %loop
```
But the select condition can be inverted:
```
	%cmp1 = icmp eq i32* %f, %y
	%sel = select i1 %cmp1, i32* null, i32* %f
```
The fix is to enhance "Correlated Value Propagation" to handle both branches of the select instruction.

Reviewed By: nikic, lebedev.ri

Differential Revision: https://reviews.llvm.org/D119643
2022-02-23 00:11:20 +04:00
..
2010-09-02-Trunc.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
2010-09-26-MergeConstantRange.ll
abs.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
add.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
alloca.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
and.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
ashr.ll [CVP] Remove ashr of -1 or 0 2021-11-29 15:32:09 -08:00
basic.ll [Transforms] Enhance CorrelatedValuePropagation to handle both values of select 2022-02-23 00:11:20 +04:00
conflict.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
crash.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
deopt.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
guards.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
icmp.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
merge-range-and-undef.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
min-max.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
minmaxabs.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
mul.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
non-null.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
overflow_predicate.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
overflows.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
phi-common-val.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
pointer.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
pr35807.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
profmd.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
range.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
sdiv.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
select.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
sext.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
shl.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
srem.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
sub.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
udiv.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00
urem.ll [test] Use -passes syntax when specifying pipeline in some more tests 2021-11-27 09:52:55 +01:00