[llvm] Add the 'initializes' attribute langref and support (PR #84803)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 14:23:11 PDT 2024


================
@@ -0,0 +1,69 @@
+//===- ConstantRangeList.cpp - ConstantRangeList implementation -----------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// Represent a list of signed ConstantRange and do NOT support wrap around the
+// end of the numeric range. Ranges in the list are ordered and no overlapping.
+// Ranges should have the same bitwidth. Each range's lower should be less than
+// its upper.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/IR/ConstantRangeList.h"
+#include <cstddef>
+
+using namespace llvm;
+
+void ConstantRangeList::insert(const ConstantRange &NewRange) {
----------------
aeubanks wrote:

I wonder how often we insert a range that we already have in the list, then we could return immediately without doing any work

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


More information about the llvm-commits mailing list