Skip to content

Make use of getelementptr nuw in pointer::add #137217

Closed
@nikic

Description

@nikic

add() on pointers should generate getelementptr inbounds nuw on LLVM 20 and above, to let LLVM know that the offset cannot be negative. We'll need a new variant of intrinsic::offset to pass down this information.

Metadata

Metadata

Assignees

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions