Repository navigation
Upgrade to LLVM 23.1.0 - #722
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 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".
| let parameters = (ins APIntParameter<"felt constant value">:$value); | ||
| let parameters = | ||
| (ins WidthInsensitiveAPIntParameter<"felt constant value">:$value); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Generate smt.int.sub 0, x in place of deleted smt.int.neg
| static Edge getEmptyKey() { return Edge(nullptr, BaseInfo::getEmptyKey()); } | ||
| static Edge getTombstoneKey() { return Edge(nullptr, BaseInfo::getTombstoneKey()); } |
There was a problem hiding this comment.
The upstream DenseMap implementation no longer requires these.
| let results = (outs I1:$result); | ||
| let assemblyFormat = [{ | ||
| `` $predicate `(` $lhs `,` $rhs `)` | ||
| $predicate `(` $lhs `,` $rhs `)` |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 = ""> |
There was a problem hiding this comment.
Width-sensitive version is now the upstream APIntParameter
| /// 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"; | ||
| } | ||
|
|
There was a problem hiding this comment.
Now available upstream as HasAncestor and AncestorOneOf
| // Per-call argument and result attribute dictionaries required by | ||
| // CallOpInterface. | ||
| OptionalAttr<DictArrayAttr>:$arg_attrs, | ||
| OptionalAttr<DictArrayAttr>:$res_attrs); |
There was a problem hiding this comment.
Required by CallOpInterface and were previously auto-generated in older LLVM version.
| void getDependentDialects(DialectRegistry ®istry) const override { | ||
| auto nestedPM = createPostScalarizationPipeline(); | ||
| nestedPM.getDependentDialects(registry); | ||
| } |
There was a problem hiding this comment.
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.
| /// 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); | ||
| } | ||
| } | ||
| } | ||
|
|
| // 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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Upstream changed the location description for -split-input-file inputs
| // CHECK-NEXT: function.def private @sink() | ||
| // CHECK-NEXT: function.def @sink() { | ||
| // CHECK-NEXT: function.return | ||
| // CHECK-NEXT: } |
There was a problem hiding this comment.
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:* | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
#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:* | |||
There was a problem hiding this comment.
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.
See changelog and additional explanations in diff comments.