InstCombine transforms this:
%struct.A = type { [123 x i8], i32 }
define ptr @struct2(ptr %p) {
%1 = getelementptr inbounds %struct.A, ptr %p, i64 0, i32 1
%2 = getelementptr inbounds i8, ptr %1, i64 -128
ret ptr %2
}
into:
define nonnull ptr @struct2(ptr readnone %p) {
%1 = getelementptr inbounds %struct.A, ptr %p, i64 -1, i32 1
ret ptr %1
}
The transformation seems to have been introduced in LLVM 14.
https://alive2.llvm.org/ce/z/8KGF2j
InstCombine transforms this:
into:
The transformation seems to have been introduced in LLVM 14.
https://alive2.llvm.org/ce/z/8KGF2j