Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dialects: (llvm) Add support for overflow flags #3293

Merged
merged 10 commits into from
Oct 14, 2024
Merged

Conversation

lfrenot
Copy link
Collaborator

@lfrenot lfrenot commented Oct 11, 2024

No description provided.

@lfrenot lfrenot added the dialects Changes on the dialects label Oct 11, 2024
@lfrenot lfrenot self-assigned this Oct 11, 2024
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.02%. Comparing base (c33f7b3) to head (4cd8290).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3293      +/-   ##
==========================================
+ Coverage   89.99%   90.02%   +0.02%     
==========================================
  Files         445      445              
  Lines       55749    55898     +149     
  Branches     5367     5353      -14     
==========================================
+ Hits        50173    50321     +148     
- Misses       4166     4169       +3     
+ Partials     1410     1408       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 8 to 18
%add_nuw = llvm.add %arg0, %arg1 {"overflowFlags" = #llvm.overflow<nuw>} : i32
// CHECK: %add_nuw = llvm.add %arg0, %arg1 {"overflowFlags" = #llvm.overflow<nuw>} : i32

%sub = llvm.sub %arg0, %arg1 : i32
// CHECK: %sub = llvm.sub %arg0, %arg1 : i32
%add_none = llvm.add %arg0, %arg1 {"overflowFlags" = #llvm.overflow<none>} : i32
// CHECK: %add_none = llvm.add %arg0, %arg1 {"overflowFlags" = #llvm.overflow<none>} : i32

%mul = llvm.mul %arg0, %arg1 : i32
// CHECK: %mul = llvm.mul %arg0, %arg1 : i32
%add_both = llvm.add %arg0, %arg1 {"overflowFlags" = #llvm.overflow<nsw, nuw>} : i32
// CHECK: %add_both = llvm.add %arg0, %arg1 {"overflowFlags" = #llvm.overflow<nsw,nuw>} : i32

%udiv = llvm.udiv %arg0, %arg1 : i32
// CHECK: %udiv = llvm.udiv %arg0, %arg1 : i32
%add_both_reverse = llvm.add %arg0, %arg1 {"overflowFlags" = #llvm.overflow<nuw, nsw>} : i32
// CHECK: %add_both_reverse = llvm.add %arg0, %arg1 {"overflowFlags" = #llvm.overflow<nsw,nuw>} : i32
Copy link
Member

Choose a reason for hiding this comment

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

I think we should be safe to remove these, the tests below with the custom syntax cover it enough, IMO

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay
I still kept one test with the complete syntax

Copy link
Member

@superlopuh superlopuh left a comment

Choose a reason for hiding this comment

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

Thank you!

@lfrenot lfrenot merged commit 322c1b1 into main Oct 14, 2024
14 checks passed
@lfrenot lfrenot deleted the llvm-overflow-flags branch October 14, 2024 15:21
EdmundGoodman pushed a commit to EdmundGoodman/xdsl that referenced this pull request Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialects Changes on the dialects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants