aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@quicinc.com>2023-05-03 15:52:12 -0700
committerKrzysztof Parzyszek <kparzysz@quicinc.com>2023-05-10 14:51:57 -0700
commit1b1806406908c185202bd62b7315f1627bfb5aa7 (patch)
tree6401306f8d62230c702f53653f03bc6f9d540f10 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp
parent6561032e1d3c561b3f7ced817bf3350b8622bf92 (diff)
downloadllvm-1b1806406908c185202bd62b7315f1627bfb5aa7.zip
llvm-1b1806406908c185202bd62b7315f1627bfb5aa7.tar.gz
llvm-1b1806406908c185202bd62b7315f1627bfb5aa7.tar.bz2
[TableGen] Print message about dropped patterns with -debug
A selection pattern can be silently dropped if type inference fails to deduce some types. Print a message when that happens, and -debug was applied.
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index ed2eda8..1ce735c 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -4333,13 +4333,24 @@ void CodeGenDAGPatterns::ParseOnePattern(Record *TheDef,
// that register class does not accept that type, the type inference
// will lead to a contradiction, which is not an error however, but
// a sign that this pattern will simply never match.
- if (Temp.getOnlyTree()->hasPossibleType())
- for (const auto &T : Pattern.getTrees())
+ if (Temp.getOnlyTree()->hasPossibleType()) {
+ for (const auto &T : Pattern.getTrees()) {
if (T->hasPossibleType())
AddPatternToMatch(&Pattern,
PatternToMatch(TheDef, Preds, T, Temp.getOnlyTree(),
InstImpResults, Complexity,
TheDef->getID()));
+ }
+ } else {
+ // Show a message about a dropped pattern with some info to make it
+ // easier to identify it in the .td files.
+ LLVM_DEBUG({
+ dbgs() << "Dropping: ";
+ Pattern.dump();
+ Temp.getOnlyTree()->dump();
+ dbgs() << "\n";
+ });
+ }
}
void CodeGenDAGPatterns::ParsePatterns() {