-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.
Description
We can set this in arbitrary metadata, and then write an LLVM pass to consume it and mark them as non-null.
This is awful:
pub fn foo(x: &int) -> bool {
Some(x) == None
}
; Function Attrs: nounwind readonly uwtable
define i8 @_ZN3foo19h6e99b0040329bc59af4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, i64*) unnamed_addr #0 {
entry-block:
%2 = icmp eq i64* %1, null
%. = zext i1 %2 to i8
ret i8 %.
}
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.