[llvm] [IR] Reject unhandled assume bundles and seperate them from normal attributes (PR #197007)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 4 02:00:09 PDT 2026
================
@@ -0,0 +1,63 @@
+//===- llvm/BundleAttributes.h - LLVM Bundle Attributes ---------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_IR_BUNDLE_ATTRIBUTES_H
+#define LLVM_IR_BUNDLE_ATTRIBUTES_H
+
+#include "llvm/ADT/StringRef.h"
+#include "llvm/IR/InstrTypes.h"
+
+enum class BundleAttr {
+ None,
+#define ATTR(Name, String) Name,
+#include "BundleAttributes.def"
+};
+
+namespace llvm {
+
+LLVM_ABI StringRef getNameFromBundleAttr(BundleAttr);
+LLVM_ABI BundleAttr getBundleAttrFromString(StringRef);
+
+inline BundleAttr getBundleAttrFromOBU(OperandBundleUse OBU) {
+ return getBundleAttrFromString(OBU.getTagName());
+}
+
+struct AssumeAlignInfo {
+ const Use &Ptr;
+ const Use &Alignment;
+ std::optional<uint64_t> AlignmentVal;
+ std::optional<uint64_t> OffsetVal;
+};
+
+LLVM_ABI AssumeAlignInfo getAssumeAlignInfo(OperandBundleUse);
+
+struct AssumeDereferenceableInfo {
+ const Use &Ptr;
+ const Use &Count;
+};
+
+LLVM_ABI
+AssumeDereferenceableInfo getAssumeDereferenceableInfo(OperandBundleUse);
+
+struct AssumeNonNullInfo {
+ Value *Ptr;
----------------
nikic wrote:
This one uses Value* and the others use `const Use &`? Intentional?
https://github.com/llvm/llvm-project/pull/197007
More information about the llvm-commits
mailing list