[all-commits] [llvm/llvm-project] 2d756d: [NFC][Codegen][X86] Add tests where we could impro...
Roman Lebedev via All-commits
all-commits at lists.llvm.org
Thu Dec 22 13:03:56 PST 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 2d756d25e68826787277ecf532048dd6d55eb2d0
https://github.com/llvm/llvm-project/commit/2d756d25e68826787277ecf532048dd6d55eb2d0
Author: Roman Lebedev <lebedev.ri at gmail.com>
Date: 2022-12-23 (Fri, 23 Dec 2022)
Changed paths:
M llvm/test/CodeGen/X86/freeze-vector.ll
Log Message:
-----------
[NFC][Codegen][X86] Add tests where we could improve `freeze` handling
Commit: f5700e7b69048de958172fb513b336564e7f8709
https://github.com/llvm/llvm-project/commit/f5700e7b69048de958172fb513b336564e7f8709
Author: Roman Lebedev <lebedev.ri at gmail.com>
Date: 2022-12-23 (Fri, 23 Dec 2022)
Changed paths:
M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
M llvm/test/CodeGen/X86/freeze-vector.ll
Log Message:
-----------
[DAGCombine][X86] Pull one-use `freeze` out of `extract_vector_elt` vector operand
This may allow us to further simplify the vector,
and freezing the extracted result is still fine:
```
----------------------------------------
define i8 @src(<2 x i8> %src, i64 %idx) {
%0:
%i1 = freeze <2 x i8> %src
%i2 = extractelement <2 x i8> %i1, i64 %idx
ret i8 %i2
}
=>
define i8 @tgt(<2 x i8> %src, i64 %idx) {
%0:
%i1 = extractelement <2 x i8> %src, i64 %idx
%i2 = freeze i8 %i1
ret i8 %i2
}
Transformation seems to be correct!
```
BUT, there must not be other uses of that freeze,
see `@freeze_extractelement_extra_use`.
Also, looks like we are missing some ISEL-level handling for freeze.
Compare: https://github.com/llvm/llvm-project/compare/46cd3127fe54...f5700e7b6904
More information about the All-commits
mailing list