Skip to content

Upgrade to LLVM 23.1.0 - #722

Merged
tim-hoffman merged 92 commits into
mainfrom
th/llvm23
Sep 29, 2026
Merged

tim-hoffman merged 92 commits into
mainfrom
th/llvm23

Conversation

@tim-hoffman

@tim-hoffman tim-hoffman commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

See changelog and additional explanations in diff comments.

@tim-hoffman
tim-hoffman requested a review from a team as a code owner September 28, 2026 13:26
@tim-hoffman

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef159730c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread include/llzk/Dialect/SMTInfo/IR/CMakeLists.txt
Comment thread CMakeLists.txt Outdated
Comment on lines -20 to +21
let parameters = (ins APIntParameter<"felt constant value">:$value);
let parameters =
(ins WidthInsensitiveAPIntParameter<"felt constant value">:$value);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MLIR added APIntParameter so the LLZK version changed to WidthInsensitiveAPIntParameter to preserve the width-insensitive semantics the LLZK version had.

let name = "pcl";
let summary = "PCL";
let cppNamespace = "::pcl";
let usePropertiesForAttributes = 0;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MLIR removed this option (it was previously deprecated).

auto lhs = adaptor.getTrueValue();
auto rhs = adaptor.getFalseValue();
Value temp = rewriter.create<pcl::VarOp>(location, *tempName, /*public=*/false);
Value temp = pcl::VarOp::create(rewriter, location, *tempName, /*public=*/false);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the most common change, builder.create<Type>(...) was replaced with Type::create(builder,...).

) const override;
};

/// Lower felt negation to upstream SMT subtraction from an explicit zero.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generate smt.int.sub 0, x in place of deleted smt.int.neg

Comment on lines -135 to -136
static Edge getEmptyKey() { return Edge(nullptr, BaseInfo::getEmptyKey()); }
static Edge getTombstoneKey() { return Edge(nullptr, BaseInfo::getTombstoneKey()); }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The upstream DenseMap implementation no longer requires these.

let results = (outs I1:$result);
let assemblyFormat = [{
`` $predicate `(` $lhs `,` $rhs `)`
$predicate `(` $lhs `,` $rhs `)`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This previously avoided printing a space at the start but some printer upstream has changed so the space here is now necessary to print bool.cmp ne instead of incorrectly printing bool.cmpne.

/// Memory resource indicating a `global.def` memory resource.
struct GlobalMemoryResource : public mlir::SideEffects::Resource::Base<GlobalMemoryResource> {
mlir::StringRef getName() final;
mlir::StringRef getName() const final;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream API now uses const


// APInts whose bitwidth is part of their identity. Check it before operator==,
// which requires equal widths.
class WidthSensitiveAPIntParameter<string desc = "">

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Width-sensitive version is now the upstream APIntParameter

Comment on lines -35 to -49
/// Verify that the operation has a parent of type `op` somewhere in its
/// ancestry.
class HasAncestor<string op> : ParamNativeOpTrait<"HasAncestor", op>,
StructuralOpTrait {
string cppNamespace = "::llzk";
}

/// Verify that the operation has a parent of one of the `ops` types somewhere
/// in its ancestry.
class HasAncestorOf<list<string> ops>
: ParamNativeOpTrait<"HasAncestor", !interleave(ops, ", ")>,
StructuralOpTrait {
string cppNamespace = "::llzk";
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now available upstream as HasAncestor and AncestorOneOf

Comment on lines +386 to +389
// Per-call argument and result attribute dictionaries required by
// CallOpInterface.
OptionalAttr<DictArrayAttr>:$arg_attrs,
OptionalAttr<DictArrayAttr>:$res_attrs);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required by CallOpInterface and were previously auto-generated in older LLVM version.

Comment on lines +1102 to +1105
void getDependentDialects(DialectRegistry &registry) const override {
auto nestedPM = createPostScalarizationPipeline();
nestedPM.getDependentDialects(registry);
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refactoring in this file was done to add this function override which is necessary to ensure all dialects needed by the pass are loaded before the pass runs.

Comment on lines -460 to -472
/// For each Type in the given input collection, call `splitPodArrayTypeTo(Type,...)`.
template <typename TypeCollection>
void splitPodArrayTypeTo(
TypeCollection types, SmallVectorImpl<Type> &collect, SmallVector<size_t> *originalIdxToSize
) {
for (Type t : types) {
size_t count = splitPodArrayTypeTo(t, collect);
if (originalIdxToSize) {
originalIdxToSize->push_back(count);
}
}
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused

Comment on lines -61 to -76
// CHECK-NEXT: <@TA::@A::@compute>:%self = struct.new : <@TA::@A<[@Start, @Stop, @Step]>> predecessors:
// CHECK-NEXT: <(no parent function op)>:function.def @compute(%arg0: !felt.type) -> !struct.type<@TA::@A<[@Start, @Stop, @Step]>> attributes {function.allow_witness} {...}
// CHECK-NEXT: <@TA::@A::@compute>:%array = array.new : <4 x !felt.type> predecessors:
// CHECK-NEXT: <@TA::@A::@compute>:%self = struct.new : <@TA::@A<[@Start, @Stop, @Step]>>
// CHECK-NEXT: <@TA::@A::@compute>:%c0 = arith.constant 0 : index predecessors:
// CHECK-NEXT: <@TA::@A::@compute>:%array = array.new : <4 x !felt.type>
// CHECK-NEXT: <@TA::@A::@compute>:%c1 = arith.constant 1 : index predecessors:
// CHECK-NEXT: <@TA::@A::@compute>:%c0 = arith.constant 0 : index
// CHECK-NEXT: <@TA::@A::@compute>:%c4 = arith.constant 4 : index predecessors:
// CHECK-NEXT: <@TA::@A::@compute>:%c1 = arith.constant 1 : index
// CHECK-NEXT: <@TA::@A::@compute>:%0 = poly.read_const @Start : index predecessors:
// CHECK-NEXT: <@TA::@A::@compute>:%c4 = arith.constant 4 : index
// CHECK-NEXT: <@TA::@A::@compute>:%1 = poly.read_const @Stop : index predecessors:
// CHECK-NEXT: <@TA::@A::@compute>:%0 = poly.read_const @Start : index
// CHECK-NEXT: <@TA::@A::@compute>:%2 = poly.read_const @Step : index predecessors:
// CHECK-NEXT: <@TA::@A::@compute>:%1 = poly.read_const @Stop : index

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was moved below verbatim due to internal data structure change

//CHECK-LABEL: ---- SymbolUseGraph ----
//CHECK-NEXT: - Node : [0x[[R01:[0-9a-f]+]]] '@HasUse::@compute' with root module @"<<symbol lookup root>>"
//CHECK-NEXT: --- loc("within split at {{.*}}symbol_use_graph_pass.llzk:1 offset ":8:5)
//CHECK-NEXT: --- loc("{{.*}}symbol_use_graph_pass.llzk":8:5)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream changed the location description for -split-input-file inputs

Comment on lines -85 to +88
// CHECK-NEXT: function.def private @sink()
// CHECK-NEXT: function.def @sink() {
// CHECK-NEXT: function.return
// CHECK-NEXT: }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't like this def without a body anymore but that wasn't the point of the test anyway so I changed it. That causes the removal of 2 lines below due to the empty body now being inlined.

@@ -1,4 +1,5 @@
// RUN: llzk-opt -split-input-file -llzk-pod-to-scalar -verify-diagnostics %s
// XFAIL:*

@tim-hoffman tim-hoffman Sep 28, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The improved RDV pass (run independently without pod-to-scalar) now deletes the loop carried pods in most of these cases (all but the first), thus bypassing the original purpose of the tests.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#759 also affects several of the tests in this file

@@ -1,4 +1,5 @@
// RUN: llzk-opt -split-input-file -llzk-pod-to-scalar -verify-diagnostics %s
// XFAIL:*

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The improved RDV pass (run independently without pod-to-scalar) now deletes the loop carried pods in each of these cases, thus bypassing the original purpose of the test.

@shankarapailoor shankarapailoor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tim-hoffman
tim-hoffman merged commit 8cc9ef9 into main Sep 29, 2026
10 checks passed
@tim-hoffman
tim-hoffman deleted the th/llvm23 branch September 29, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants