Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/CodeGen/AArch64/load-combine.ll
Show First 20 Lines • Show All 493 Lines • ▼ Show 20 Lines | ; CHECK-NEXT: ret | ||||
ret i32 %tmp8 | ret i32 %tmp8 | ||||
} | } | ||||
; i8* p; // p is 2 byte aligned | ; i8* p; // p is 2 byte aligned | ||||
; (i32) p[1] | ((i32) p[0] << 8) | ; (i32) p[1] | ((i32) p[0] << 8) | ||||
define i32 @zext_load_i32_by_i8_bswap(i32* %arg) { | define i32 @zext_load_i32_by_i8_bswap(i32* %arg) { | ||||
; CHECK-LABEL: zext_load_i32_by_i8_bswap: | ; CHECK-LABEL: zext_load_i32_by_i8_bswap: | ||||
; CHECK: // %bb.0: | ; CHECK: // %bb.0: | ||||
; CHECK-NEXT: ldrh w8, [x0] | ; CHECK-NEXT: ldrh w8, [x0] | ||||
; CHECK-NEXT: lsl w8, w8, #16 | ; CHECK-NEXT: rev w8, w8 | ||||
; CHECK-NEXT: rev w0, w8 | ; CHECK-NEXT: lsr w0, w8, #16 | ||||
; CHECK-NEXT: ret | ; CHECK-NEXT: ret | ||||
%tmp = bitcast i32* %arg to i8* | %tmp = bitcast i32* %arg to i8* | ||||
%tmp1 = getelementptr inbounds i8, i8* %tmp, i32 1 | %tmp1 = getelementptr inbounds i8, i8* %tmp, i32 1 | ||||
%tmp2 = load i8, i8* %tmp1, align 1 | %tmp2 = load i8, i8* %tmp1, align 1 | ||||
%tmp3 = zext i8 %tmp2 to i32 | %tmp3 = zext i8 %tmp2 to i32 | ||||
%tmp4 = getelementptr inbounds i8, i8* %tmp, i32 0 | %tmp4 = getelementptr inbounds i8, i8* %tmp, i32 0 | ||||
%tmp5 = load i8, i8* %tmp4, align 2 | %tmp5 = load i8, i8* %tmp4, align 2 | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |