[PATCH] D25013: [x86][inline-asm][avx512] allow swapping of '{k<num>}' & '{z}' marks

Elena Demikhovsky via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 05:33:51 PDT 2016


delena added inline comments.

================
Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:1887
@@ -1881,1 +1886,3 @@
 
+// False on failure, true otherwise
+bool X86AsmParser::ParseZ(std::unique_ptr<X86Operand> &Z, bool IsExpected,
----------------
Please add more comments about functionality.

================
Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:1888
@@ +1887,3 @@
+// False on failure, true otherwise
+bool X86AsmParser::ParseZ(std::unique_ptr<X86Operand> &Z, bool IsExpected,
+                          const SMLoc &StartLoc) {
----------------
I suggest to remove IsExpected. Just look for Z and return true if found.

================
Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:1908
@@ +1907,3 @@
+
+// False on failure, true otherwise
+bool X86AsmParser::ParseK(OperandVector &Operands, const SMLoc &StartLoc,
----------------
Comments about what this function does.

================
Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:1909
@@ +1908,3 @@
+// False on failure, true otherwise
+bool X86AsmParser::ParseK(OperandVector &Operands, const SMLoc &StartLoc,
+                          bool *FoundK) {
----------------
I suggest to return found/not-found. Looks like you continue parsing after error.

================
Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:1914
@@ +1913,3 @@
+  // Assuming we are just pass the '{' mark, quering the next token
+  if (std::unique_ptr<X86Operand> Op = ParseOperand()) {
+    if (!getLexer().is(AsmToken::RCurly))
----------------
can you use "auto" instead of std::unique_ptr<X86Operand> ?

================
Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:1916
@@ +1915,3 @@
+    if (!getLexer().is(AsmToken::RCurly))
+      return !Error(getLexer().getLoc(), "Expected } at this point");
+    Operands.push_back(X86Operand::CreateToken("{", StartLoc));
----------------
Why return !Error()  ??
Should we assume that Error() returns true?


Repository:
  rL LLVM

https://reviews.llvm.org/D25013





More information about the llvm-commits mailing list