Skip to content

Commit

Permalink
Regenerate dialects
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Jul 23, 2024
1 parent 1e5e8a2 commit 897ebe6
Show file tree
Hide file tree
Showing 60 changed files with 21,490 additions and 21,151 deletions.
30 changes: 22 additions & 8 deletions src/Dialects/16/Arith.jl
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,19 @@ attribute by the parser.
%r3 = \"arith.cmpf\"(%0, %1) {predicate: 0} : (f8, f8) -> i1
```
"""
function cmpf(lhs::Value, rhs::Value; result::IR.Type, predicate, location=Location())
_results = IR.Type[result,]
function cmpf(
lhs::Value,
rhs::Value;
result=nothing::Union{Nothing,IR.Type},
predicate,
location=Location(),
)
_results = IR.Type[]
_operands = Value[lhs, rhs]
_owned_regions = Region[]
_successors = Block[]
_attributes = NamedAttribute[namedattribute("predicate", predicate),]
!isnothing(result) && push!(_results, result)

return IR.create_operation(
"arith.cmpf",
Expand All @@ -337,8 +344,8 @@ function cmpf(lhs::Value, rhs::Value; result::IR.Type, predicate, location=Locat
owned_regions=_owned_regions,
successors=_successors,
attributes=_attributes,
results=_results,
result_inference=false,
results=(length(_results) == 0 ? nothing : _results),
result_inference=(length(_results) == 0 ? true : false),
)
end

Expand Down Expand Up @@ -407,12 +414,19 @@ complement or large positives
: (vector<4xi64>, vector<4xi64>) -> vector<4xi1>
```
"""
function cmpi(lhs::Value, rhs::Value; result::IR.Type, predicate, location=Location())
_results = IR.Type[result,]
function cmpi(
lhs::Value,
rhs::Value;
result=nothing::Union{Nothing,IR.Type},
predicate,
location=Location(),
)
_results = IR.Type[]
_operands = Value[lhs, rhs]
_owned_regions = Region[]
_successors = Block[]
_attributes = NamedAttribute[namedattribute("predicate", predicate),]
!isnothing(result) && push!(_results, result)

return IR.create_operation(
"arith.cmpi",
Expand All @@ -421,8 +435,8 @@ function cmpi(lhs::Value, rhs::Value; result::IR.Type, predicate, location=Locat
owned_regions=_owned_regions,
successors=_successors,
attributes=_attributes,
results=_results,
result_inference=false,
results=(length(_results) == 0 ? nothing : _results),
result_inference=(length(_results) == 0 ? true : false),
)
end

Expand Down
11 changes: 7 additions & 4 deletions src/Dialects/16/Async.jl
Original file line number Diff line number Diff line change
Expand Up @@ -738,12 +738,15 @@ end
The `async.runtime.load` operation loads the value from the runtime
async.value storage.
"""
function runtime_load(storage::Value; result::IR.Type, location=Location())
_results = IR.Type[result,]
function runtime_load(
storage::Value; result=nothing::Union{Nothing,IR.Type}, location=Location()
)
_results = IR.Type[]
_operands = Value[storage,]
_owned_regions = Region[]
_successors = Block[]
_attributes = NamedAttribute[]
!isnothing(result) && push!(_results, result)

return IR.create_operation(
"async.runtime.load",
Expand All @@ -752,8 +755,8 @@ function runtime_load(storage::Value; result::IR.Type, location=Location())
owned_regions=_owned_regions,
successors=_successors,
attributes=_attributes,
results=_results,
result_inference=false,
results=(length(_results) == 0 ? nothing : _results),
result_inference=(length(_results) == 0 ? true : false),
)
end

Expand Down
11 changes: 7 additions & 4 deletions src/Dialects/16/Bufferization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,15 @@ involving tensors and memrefs.
If tensor load is used in the bufferization steps, mutating the source
buffer after loading leads to undefined behavior.
"""
function to_tensor(memref::Value; result::IR.Type, location=Location())
_results = IR.Type[result,]
function to_tensor(
memref::Value; result=nothing::Union{Nothing,IR.Type}, location=Location()
)
_results = IR.Type[]
_operands = Value[memref,]
_owned_regions = Region[]
_successors = Block[]
_attributes = NamedAttribute[]
!isnothing(result) && push!(_results, result)

return IR.create_operation(
"bufferization.to_tensor",
Expand All @@ -242,8 +245,8 @@ function to_tensor(memref::Value; result::IR.Type, location=Location())
owned_regions=_owned_regions,
successors=_successors,
attributes=_attributes,
results=_results,
result_inference=false,
results=(length(_results) == 0 ? nothing : _results),
result_inference=(length(_results) == 0 ? true : false),
)
end

Expand Down
36 changes: 20 additions & 16 deletions src/Dialects/16/Complex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ The `abs` op takes a single complex number and computes its absolute value.
%a = complex.abs %b : complex<f32>
```
"""
function abs(complex::Value; result::IR.Type, location=Location())
_results = IR.Type[result,]
function abs(complex::Value; result=nothing::Union{Nothing,IR.Type}, location=Location())
_results = IR.Type[]
_operands = Value[complex,]
_owned_regions = Region[]
_successors = Block[]
_attributes = NamedAttribute[]
!isnothing(result) && push!(_results, result)

return IR.create_operation(
"complex.abs",
Expand All @@ -29,8 +30,8 @@ function abs(complex::Value; result::IR.Type, location=Location())
owned_regions=_owned_regions,
successors=_successors,
attributes=_attributes,
results=_results,
result_inference=false,
results=(length(_results) == 0 ? nothing : _results),
result_inference=(length(_results) == 0 ? true : false),
)
end

Expand Down Expand Up @@ -78,12 +79,13 @@ The `angle` op takes a single complex number and computes its argument value wit
%a = complex.angle %b : complex<f32>
```
"""
function angle(complex::Value; result::IR.Type, location=Location())
_results = IR.Type[result,]
function angle(complex::Value; result=nothing::Union{Nothing,IR.Type}, location=Location())
_results = IR.Type[]
_operands = Value[complex,]
_owned_regions = Region[]
_successors = Block[]
_attributes = NamedAttribute[]
!isnothing(result) && push!(_results, result)

return IR.create_operation(
"complex.angle",
Expand All @@ -92,8 +94,8 @@ function angle(complex::Value; result::IR.Type, location=Location())
owned_regions=_owned_regions,
successors=_successors,
attributes=_attributes,
results=_results,
result_inference=false,
results=(length(_results) == 0 ? nothing : _results),
result_inference=(length(_results) == 0 ? true : false),
)
end

Expand Down Expand Up @@ -403,12 +405,13 @@ The `im` op takes a single complex number and extracts the imaginary part.
%a = complex.im %b : complex<f32>
```
"""
function im(complex::Value; imaginary::IR.Type, location=Location())
_results = IR.Type[imaginary,]
function im(complex::Value; imaginary=nothing::Union{Nothing,IR.Type}, location=Location())
_results = IR.Type[]
_operands = Value[complex,]
_owned_regions = Region[]
_successors = Block[]
_attributes = NamedAttribute[]
!isnothing(imaginary) && push!(_results, imaginary)

return IR.create_operation(
"complex.im",
Expand All @@ -417,8 +420,8 @@ function im(complex::Value; imaginary::IR.Type, location=Location())
owned_regions=_owned_regions,
successors=_successors,
attributes=_attributes,
results=_results,
result_inference=false,
results=(length(_results) == 0 ? nothing : _results),
result_inference=(length(_results) == 0 ? true : false),
)
end

Expand Down Expand Up @@ -630,12 +633,13 @@ The `re` op takes a single complex number and extracts the real part.
%a = complex.re %b : complex<f32>
```
"""
function re(complex::Value; real::IR.Type, location=Location())
_results = IR.Type[real,]
function re(complex::Value; real=nothing::Union{Nothing,IR.Type}, location=Location())
_results = IR.Type[]
_operands = Value[complex,]
_owned_regions = Region[]
_successors = Block[]
_attributes = NamedAttribute[]
!isnothing(real) && push!(_results, real)

return IR.create_operation(
"complex.re",
Expand All @@ -644,8 +648,8 @@ function re(complex::Value; real::IR.Type, location=Location())
owned_regions=_owned_regions,
successors=_successors,
attributes=_attributes,
results=_results,
result_inference=false,
results=(length(_results) == 0 ? nothing : _results),
result_inference=(length(_results) == 0 ? true : false),
)
end

Expand Down
35 changes: 23 additions & 12 deletions src/Dialects/16/LLVMIR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -556,12 +556,15 @@ end
`extractelement`
"""
function extractelement(vector::Value, position::Value; res::IR.Type, location=Location())
_results = IR.Type[res,]
function extractelement(
vector::Value, position::Value; res=nothing::Union{Nothing,IR.Type}, location=Location()
)
_results = IR.Type[]
_operands = Value[vector, position]
_owned_regions = Region[]
_successors = Block[]
_attributes = NamedAttribute[]
!isnothing(res) && push!(_results, res)

return IR.create_operation(
"llvm.extractelement",
Expand All @@ -570,8 +573,8 @@ function extractelement(vector::Value, position::Value; res::IR.Type, location=L
owned_regions=_owned_regions,
successors=_successors,
attributes=_attributes,
results=_results,
result_inference=false,
results=(length(_results) == 0 ? nothing : _results),
result_inference=(length(_results) == 0 ? true : false),
)
end

Expand Down Expand Up @@ -637,16 +640,17 @@ end
function fcmp(
lhs::Value,
rhs::Value;
res::IR.Type,
res=nothing::Union{Nothing,IR.Type},
predicate,
fastmathFlags=nothing,
location=Location(),
)
_results = IR.Type[res,]
_results = IR.Type[]
_operands = Value[lhs, rhs]
_owned_regions = Region[]
_successors = Block[]
_attributes = NamedAttribute[namedattribute("predicate", predicate),]
!isnothing(res) && push!(_results, res)
!isnothing(fastmathFlags) &&
push!(_attributes, namedattribute("fastmathFlags", fastmathFlags))

Expand All @@ -657,8 +661,8 @@ function fcmp(
owned_regions=_owned_regions,
successors=_successors,
attributes=_attributes,
results=_results,
result_inference=false,
results=(length(_results) == 0 ? nothing : _results),
result_inference=(length(_results) == 0 ? true : false),
)
end

Expand Down Expand Up @@ -1249,12 +1253,19 @@ end
`icmp`
"""
function icmp(lhs::Value, rhs::Value; res::IR.Type, predicate, location=Location())
_results = IR.Type[res,]
function icmp(
lhs::Value,
rhs::Value;
res=nothing::Union{Nothing,IR.Type},
predicate,
location=Location(),
)
_results = IR.Type[]
_operands = Value[lhs, rhs]
_owned_regions = Region[]
_successors = Block[]
_attributes = NamedAttribute[namedattribute("predicate", predicate),]
!isnothing(res) && push!(_results, res)

return IR.create_operation(
"llvm.icmp",
Expand All @@ -1263,8 +1274,8 @@ function icmp(lhs::Value, rhs::Value; res::IR.Type, predicate, location=Location
owned_regions=_owned_regions,
successors=_successors,
attributes=_attributes,
results=_results,
result_inference=false,
results=(length(_results) == 0 ? nothing : _results),
result_inference=(length(_results) == 0 ? true : false),
)
end

Expand Down
14 changes: 10 additions & 4 deletions src/Dialects/16/MemRef.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,18 @@ techniques. This is possible because of the
[restrictions on dimensions and symbols](Affine.md/#restrictions-on-dimensions-and-symbols)
in these contexts.
"""
function load(memref::Value, indices::Vector{Value}; result::IR.Type, location=Location())
_results = IR.Type[result,]
function load(
memref::Value,
indices::Vector{Value};
result=nothing::Union{Nothing,IR.Type},
location=Location(),
)
_results = IR.Type[]
_operands = Value[memref, indices...]
_owned_regions = Region[]
_successors = Block[]
_attributes = NamedAttribute[]
!isnothing(result) && push!(_results, result)

return IR.create_operation(
"memref.load",
Expand All @@ -236,8 +242,8 @@ function load(memref::Value, indices::Vector{Value}; result::IR.Type, location=L
owned_regions=_owned_regions,
successors=_successors,
attributes=_attributes,
results=_results,
result_inference=false,
results=(length(_results) == 0 ? nothing : _results),
result_inference=(length(_results) == 0 ? true : false),
)
end

Expand Down
Loading

0 comments on commit 897ebe6

Please sign in to comment.