[PATCH] D61705: Tablegen type comparison LE should be LT or equal.
Pete Couperus via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 20 11:07:03 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL361183: [TableGen] - Type comparison LE should be LT or equal. (authored by petecoup, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D61705?vs=198741&id=200337#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61705/new/
https://reviews.llvm.org/D61705
Files:
llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp
Index: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp
===================================================================
--- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp
+++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -507,22 +507,14 @@
(A.getScalarSizeInBits() == B.getScalarSizeInBits() &&
A.getSizeInBits() < B.getSizeInBits());
};
- auto LE = [](MVT A, MVT B) -> bool {
+ auto LE = [<](MVT A, MVT B) -> bool {
// This function is used when removing elements: when a vector is compared
// to a non-vector, it should return false (to avoid removal).
if (A.isVector() != B.isVector())
return false;
- // Note on the < comparison below:
- // X86 has patterns like
- // (set VR128X:$dst, (v16i8 (X86vtrunc (v4i32 VR128X:$src1)))),
- // where the truncated vector is given a type v16i8, while the source
- // vector has type v4i32. They both have the same size in bits.
- // The minimal type in the result is obviously v16i8, and when we remove
- // all types from the source that are smaller-or-equal than v8i16, the
- // only source type would also be removed (since it's equal in size).
- return A.getScalarSizeInBits() <= B.getScalarSizeInBits() ||
- A.getSizeInBits() < B.getSizeInBits();
+ return LT(A, B) || (A.getScalarSizeInBits() == B.getScalarSizeInBits() &&
+ A.getSizeInBits() == B.getSizeInBits());
};
for (unsigned M : Modes) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61705.200337.patch
Type: text/x-patch
Size: 1485 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190520/8014b50b/attachment.bin>
More information about the llvm-commits
mailing list