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

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 15:30:13 PDT 2024


================
@@ -0,0 +1,86 @@
+//===- ConstantRangeList.h - A list of constant ranges ----------*- 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
+//
+//===----------------------------------------------------------------------===//
+//
+// 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 not overlapping.
+// Ranges should have the same bitwidth. Each range's lower should be less than
+// its upper.
----------------
aeubanks wrote:

it is convenient that the verifier can check for sorted `ConstantRangeList`s without asserting on construction, but perhaps it is better to move the checks to both LLParser and bitcode parser

a static method that returns a `std::optional<ConstantRangeList>` depending on if the input is sorted or not, and error checking in the LLParser/bitcode parser would be good. then we can assert that the input is sorted in the constructor.

(or just automatically sort ConstantRangeLists on construction, but IMO the checks can be useful for finding bugs)

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


More information about the llvm-commits mailing list