[llvm] [NVPTX] Teach NVPTX about predicates (PR #67468)

Fraser Cormack via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 03:03:07 PDT 2024


================
@@ -31,6 +31,19 @@ NVPTXInstPrinter::NVPTXInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
                                    const MCRegisterInfo &MRI)
     : MCInstPrinter(MAI, MII, MRI) {}
 
+void NVPTXInstPrinter::printPredicateOperand(const MCInst *MI, int OpNum,
+                                             raw_ostream &OS,
+                                             const char * /*Modifier*/) {
+  assert(MI->getNumOperands() == OpNum + 2 &&
+         "predicate and switch must be last");
+  unsigned Reg = MI->getOperand(OpNum).getReg();
+  unsigned Sw = MI->getOperand(OpNum + 1).getImm();
----------------
frasercrmck wrote:

I feel the use of "switch" and so on is too generic, at least in the context of predicate operands.

https://github.com/llvm/llvm-project/pull/67468


More information about the llvm-commits mailing list