-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
ClangIRAnything related to the ClangIR projectAnything related to the ClangIR project
Description
While reviewing the IR generated for this PR: #150687, we noticed that the GEP instruction is using pointer arithmetic on an i8:
%val = load i16, ptr getelementptr inbounds nuw (i8, ptr ..., i64 2), align 2Instead of using the structure type as in classic codegen:
%val = load i16, ptr getelementptr inbounds nuw (%struct.S, ptr ..., i32 0, i32 1), align 2Although both forms are semantically equivalent, the structure-based GEP is more readable and more reflective of the original source structure. It would be good to track this behavior and evaluate whether it should be aligned with classic codegen.
Metadata
Metadata
Assignees
Labels
ClangIRAnything related to the ClangIR projectAnything related to the ClangIR project