[llvm] [AMDGPU] Add AMDGPU specific variadic operation MCExprs (PR #82022)
Pierre van Houtryve via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 19 00:07:06 PST 2024
================
@@ -8130,6 +8132,53 @@ void AMDGPUAsmParser::onBeginOfFile() {
getTargetStreamer().EmitDirectiveAMDGCNTarget();
}
+/// Parse AMDGPU specific expressions.
+///
+/// expr ::= or(expr, ...) |
+/// max(expr, ...)
+///
+bool AMDGPUAsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
+ using AGVK = AMDGPUVariadicMCExpr::AMDGPUVariadicKind;
+
+ auto parseVariadicExpr = [&](AGVK Kind, const MCExpr *&res, SMLoc &EndLoc) {
+ std::vector<const MCExpr *> Exprs;
+ while (true) {
+ if (isToken(AsmToken::RParen)) {
----------------
Pierre-vh wrote:
`trySkipToken` instead of `isToken` + `lex`?
https://github.com/llvm/llvm-project/pull/82022
More information about the llvm-commits
mailing list