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

[CIR][CodeGen] Fix missing 'nsw' flag in add, sub, and mul in binop operator #677

Merged
merged 4 commits into from
Jun 20, 2024

Conversation

mingshi2333
Copy link
Contributor

This PR is to fix the missing nsw flag in issue #664 regarding add, mul arithmetic operations. there is also a problem with unary operations such as Inc ,Dec,Plus,Minus and Not . which should also have 'nsw' flag example. This part should need to be fixed through lowering.

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! LGTM after few nits!

clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp Outdated Show resolved Hide resolved
clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp Outdated Show resolved Hide resolved
@bcardosolopes bcardosolopes changed the title [CIR][CodeGen]Fix missing 'nsw' flag in add, sub, and mul in binop operator [CIR][CodeGen] Fix missing 'nsw' flag in add, sub, and mul in binop operator Jun 10, 2024
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

Thanks for the update, almost there.

clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp Outdated Show resolved Hide resolved
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

LGTM

@bcardosolopes bcardosolopes merged commit 8829868 into llvm:main Jun 20, 2024
6 checks passed
bruteforceboy pushed a commit to bruteforceboy/clangir that referenced this pull request Oct 2, 2024
…perator (llvm#677)

This PR is to fix the missing **nsw** flag in issue llvm#664 regarding add,
mul arithmetic operations. there is also a problem with unary operations
such as **Inc ,Dec,Plus,Minus and Not** . which should also have 'nsw'
flag [example](https://godbolt.org/z/q3o3jsbe1). This part should need
to be fixed through lowering.
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
…perator (llvm#677)

This PR is to fix the missing **nsw** flag in issue llvm#664 regarding add,
mul arithmetic operations. there is also a problem with unary operations
such as **Inc ,Dec,Plus,Minus and Not** . which should also have 'nsw'
flag [example](https://godbolt.org/z/q3o3jsbe1). This part should need
to be fixed through lowering.
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
…perator (llvm#677)

This PR is to fix the missing **nsw** flag in issue llvm#664 regarding add,
mul arithmetic operations. there is also a problem with unary operations
such as **Inc ,Dec,Plus,Minus and Not** . which should also have 'nsw'
flag [example](https://godbolt.org/z/q3o3jsbe1). This part should need
to be fixed through lowering.
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
…perator (llvm#677)

This PR is to fix the missing **nsw** flag in issue llvm#664 regarding add,
mul arithmetic operations. there is also a problem with unary operations
such as **Inc ,Dec,Plus,Minus and Not** . which should also have 'nsw'
flag [example](https://godbolt.org/z/q3o3jsbe1). This part should need
to be fixed through lowering.
lanza pushed a commit that referenced this pull request Nov 5, 2024
…perator (#677)

This PR is to fix the missing **nsw** flag in issue #664 regarding add,
mul arithmetic operations. there is also a problem with unary operations
such as **Inc ,Dec,Plus,Minus and Not** . which should also have 'nsw'
flag [example](https://godbolt.org/z/q3o3jsbe1). This part should need
to be fixed through lowering.
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