[PATCH] D137201: [AggressiveInstCombine] Handle the insert point of the merged load correctly.
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 3 03:05:37 PDT 2022
dmgreen added a comment.
We found another case, that looks like this where the p3 is read out of order. We are looking into getting that fixed too.
define i32 @loadCombine_4consecutive_badinsert(ptr %p) {
; LE-LABEL: @loadCombine_4consecutive_badinsert(
; LE-NEXT: [[P3:%.*]] = getelementptr i8, ptr [[P:%.*]], i32 3
; LE-NEXT: [[L1:%.*]] = load i32, ptr [[P]], align 1
; LE-NEXT: store i8 0, ptr [[P3]], align 1
; LE-NEXT: ret i32 [[L1]]
;
%p1 = getelementptr i8, ptr %p, i32 1
%p2 = getelementptr i8, ptr %p, i32 2
%p3 = getelementptr i8, ptr %p, i32 3
%l2 = load i8, ptr %p1
store i8 0, ptr %p3, align 1
%l3 = load i8, ptr %p2
%l4 = load i8, ptr %p3
%l1 = load i8, ptr %p
%e1 = zext i8 %l1 to i32
%e2 = zext i8 %l2 to i32
%e3 = zext i8 %l3 to i32
%e4 = zext i8 %l4 to i32
%s2 = shl i32 %e2, 8
%s3 = shl i32 %e3, 16
%s4 = shl i32 %e4, 24
%o1 = or i32 %e1, %s2
%o2 = or i32 %o1, %s3
%o3 = or i32 %o2, %s4
ret i32 %o3
}
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137201/new/
https://reviews.llvm.org/D137201
More information about the llvm-commits
mailing list