-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Take advantage of LLVM range metadata for enum discriminants #4924
Copy link
Copy link
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationArea: Code generationI-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.
Milestone
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationArea: Code generationI-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.
Type
Fields
Give feedbackNo fields configured for issues without a type.
According to LLVM Language Reference Manual, "range metadata may be attached only to loads of integer types. It expresses the possible ranges the loaded value is in".
Clang uses it to let LLVM know that even if bool is represented as i8 in LLVM, it can be only 0 or 1. See http://llvm.org/bugs/show_bug.cgi?id=12251