aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
authorPete Couperus <petecoup@synopsys.com>2019-05-20 18:09:37 +0000
committerPete Couperus <petecoup@synopsys.com>2019-05-20 18:09:37 +0000
commit380eaa0cfabe0b316fd69adef10eeca2c31ed2e4 (patch)
tree43d24adec0aa824234c17a99124a0fd4cdfd6b8e /llvm/utils/TableGen/CodeGenDAGPatterns.cpp
parente9585060398960d78cce6dd59b79e31e736b8f51 (diff)
downloadllvm-380eaa0cfabe0b316fd69adef10eeca2c31ed2e4.zip
llvm-380eaa0cfabe0b316fd69adef10eeca2c31ed2e4.tar.gz
llvm-380eaa0cfabe0b316fd69adef10eeca2c31ed2e4.tar.bz2
[TableGen] - Type comparison LE should be LT or equal.
Differential Revision: https://reviews.llvm.org/D61705 llvm-svn: 361183
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index 0b1687d..4b491bf 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -507,22 +507,14 @@ bool TypeInfer::EnforceSmallerThan(TypeSetByHwMode &Small,
(A.getScalarSizeInBits() == B.getScalarSizeInBits() &&
A.getSizeInBits() < B.getSizeInBits());
};
- auto LE = [](MVT A, MVT B) -> bool {
+ auto LE = [&LT](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) {