diff options
author | Craig Topper <craig.topper@sifive.com> | 2023-03-14 13:00:38 -0700 |
---|---|---|
committer | Craig Topper <craig.topper@sifive.com> | 2023-03-14 13:00:38 -0700 |
commit | 81a150656b7d856255d8073ec86fd304edd90aad (patch) | |
tree | 4dcd8eea5d7fb4026cd3395f215ee74bd542aa40 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp | |
parent | f47404b012d66ed0b411a2b3742931a14e85c80b (diff) | |
download | llvm-81a150656b7d856255d8073ec86fd304edd90aad.zip llvm-81a150656b7d856255d8073ec86fd304edd90aad.tar.gz llvm-81a150656b7d856255d8073ec86fd304edd90aad.tar.bz2 |
[TableGen][RISCV][Hexagon][LoongArch] Add a list of Predicates to HwMode.
Use the predicate condition instead of checkFeatures in *GenDAGISel.inc.
This makes the code similar to isel pattern predicates.
checkFeatures is still used by code created by SubtargetEmitter so
we can't remove the string. Backends need to be careful to keep
the string and predicates in sync, but I don't think that's a big issue.
I haven't measured it, but this should be a compile time improvement
for isel since we don't have to do any of the string processing that's
inside checkFeatures.
Reviewed By: kparzysz
Differential Revision: https://reviews.llvm.org/D146012
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index 56cf9c7..eec4de4 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -4451,14 +4451,14 @@ void CodeGenDAGPatterns::ExpandHwModeBasedTypes() { // Fill the map entry for this mode. const HwMode &HM = CGH.getMode(M); - AppendPattern(P, M, "(MF->getSubtarget().checkFeatures(\"" + HM.Features + "\"))"); + AppendPattern(P, M, HM.Predicates); // Add negations of the HM's predicates to the default predicate. if (!DefaultCheck.empty()) DefaultCheck += " && "; - DefaultCheck += "(!(MF->getSubtarget().checkFeatures(\""; - DefaultCheck += HM.Features; - DefaultCheck += "\")))"; + DefaultCheck += "!("; + DefaultCheck += HM.Predicates; + DefaultCheck += ")"; } bool HasDefault = Modes.count(DefaultMode); |