Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hercules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
Hercules
Merge requests
!25
Misc. improvements
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Misc. improvements
misc
into
main
Overview
0
Commits
21
Pipelines
0
Changes
1
Merged
rarbore2
requested to merge
misc
into
main
9 months ago
Overview
0
Commits
21
Pipelines
0
Changes
1
Expand
Emit non-zero array constants properly
Emit only actually used array constants per runtime wrapper
Juno CLI
Use repr(C) structs for product types
Minimal implementation of SROA
TODO: inlining, codegen cast, intrinsics, dynamic constant math
Edited
9 months ago
by
rarbore2
0
0
Merge request reports
Viewing commit
1b2f1221
Prev
Next
Show latest version
1 file
+
4
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
1b2f1221
Fix try_array_type
· 1b2f1221
Russel Arbore
authored
9 months ago
hercules_ir/src/ir.rs
+
4
−
4
Options
@@ -743,15 +743,15 @@ impl Constant {
}
pub
fn
try_array_type
(
&
self
,
types
:
&
[
Type
])
->
Option
<
TypeID
>
{
// Need types, since zero initializer may be for a collection type,
r
o
// Need types, since zero initializer may be for a collection type, o
r
// not.
match
self
{
Constant
::
Array
(
ty
,
_
)
=>
Some
(
*
ty
),
Constant
::
Zero
(
ty
)
=>
{
if
types
[
ty
.idx
()]
.is_primitive
()
{
None
}
else
{
if
types
[
ty
.idx
()]
.is_array
()
{
Some
(
*
ty
)
}
else
{
None
}
}
_
=>
None
,
Loading