[llvm-branch-commits] [llvm] [2/7][PISA] Add PISA IR intrinsics and address-space utilities (PR #214096)
Mateusz Chudyk via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Sep 7 03:40:12 PDT 2026
================
@@ -0,0 +1,121 @@
+//===-- PISAIntrinsicUtils.cpp --------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/IR/PISAIntrinsicUtils.h"
+#include "llvm/Support/AtomicOrdering.h"
+
+using namespace llvm;
+using namespace llvm::pisa;
+
+void pisa::printMemoryOrdering(raw_ostream &OS, const Constant *ImmArgVal) {
+ auto *CI = cast<ConstantInt>(ImmArgVal);
+ auto AO = static_cast<AtomicOrdering>(CI->getZExtValue());
+ if (static_cast<unsigned>(AO) > static_cast<unsigned>(AtomicOrdering::LAST))
+ return; // invalid value, print nothing
+ OS << toIRString(AO);
+}
+
+void pisa::printRoundingMode(raw_ostream &OS, const Constant *ImmArgVal) {
+ auto *CI = cast<ConstantInt>(ImmArgVal);
+ int64_t Val = CI->getSExtValue();
+ switch (static_cast<RoundingMode>(Val)) {
+ default:
----------------
mateuszchudyk wrote:
For consistency with the rest of the print functions, I would remove the default case.
https://github.com/llvm/llvm-project/pull/214096
More information about the llvm-branch-commits
mailing list