summaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/Common/DAGISelMatcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/TableGen/Common/DAGISelMatcher.cpp')
-rw-r--r--llvm/utils/TableGen/Common/DAGISelMatcher.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/Common/DAGISelMatcher.cpp b/llvm/utils/TableGen/Common/DAGISelMatcher.cpp
index 255974624e8f..4fdb386bf45e 100644
--- a/llvm/utils/TableGen/Common/DAGISelMatcher.cpp
+++ b/llvm/utils/TableGen/Common/DAGISelMatcher.cpp
@@ -328,6 +328,14 @@ static bool TypesAreContradictory(MVT::SimpleValueType T1,
if (T1 == T2)
return false;
+ if (T1 == MVT::pAny)
+ return TypesAreContradictory(MVT::iPTR, T2) &&
+ TypesAreContradictory(MVT::cPTR, T2);
+
+ if (T2 == MVT::pAny)
+ return TypesAreContradictory(T1, MVT::iPTR) &&
+ TypesAreContradictory(T1, MVT::cPTR);
+
// If either type is about iPtr, then they don't conflict unless the other
// one is not a scalar integer type.
if (T1 == MVT::iPTR)
@@ -336,7 +344,13 @@ static bool TypesAreContradictory(MVT::SimpleValueType T1,
if (T2 == MVT::iPTR)
return !MVT(T1).isInteger() || MVT(T1).isVector();
- // Otherwise, they are two different non-iPTR types, they conflict.
+ if (T1 == MVT::cPTR)
+ return !MVT(T2).isCheriCapability() || MVT(T2).isVector();
+
+ if (T2 == MVT::cPTR)
+ return !MVT(T1).isCheriCapability() || MVT(T1).isVector();
+
+ // Otherwise, they are two different non-iPTR/cPTR types, they conflict.
return true;
}