[llvm-branch-commits] [SPARC][IAS] Add named prefetch tag constants (PR #94249)

Sergei Barannikov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jun 3 12:18:56 PDT 2024


================
@@ -1088,6 +1115,34 @@ ParseStatus SparcAsmParser::parseASITag(OperandVector &Operands) {
   return ParseStatus::Success;
 }
 
+ParseStatus SparcAsmParser::parsePrefetchTag(OperandVector &Operands) {
+  SMLoc S = Parser.getTok().getLoc();
+  SMLoc E = Parser.getTok().getEndLoc();
+  int64_t PrefetchVal = 0;
+
+  if (getLexer().getKind() == AsmToken::Hash) {
+    SMLoc TagStart = getLexer().peekTok(false).getLoc();
+    Parser.Lex(); // Eat the '#'.
+    auto PrefetchName = Parser.getTok().getString();
+    auto PrefetchTag = SparcPrefetchTag::lookupPrefetchTagByName(PrefetchName);
----------------
s-barannikov wrote:

```suggestion
    auto *PrefetchTag = SparcPrefetchTag::lookupPrefetchTagByName(PrefetchName);
```
Or even better do not use auto.


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


More information about the llvm-branch-commits mailing list