File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,20 @@ define i8 @load_smaller_int(i16* %p) {
18
18
ret i8 %load
19
19
}
20
20
21
+ ; This case can *not* be forwarded, as we only see part of the stored value.
22
+ define i32 @load_larger_int (i16* %p ) {
23
+ ; CHECK-LABEL: @load_larger_int(
24
+ ; CHECK-NEXT: store i16 258, i16* [[P:%.*]], align 2
25
+ ; CHECK-NEXT: [[P2:%.*]] = bitcast i16* [[P]] to i32*
26
+ ; CHECK-NEXT: [[LOAD:%.*]] = load i32, i32* [[P2]], align 4
27
+ ; CHECK-NEXT: ret i32 [[LOAD]]
28
+ ;
29
+ store i16 258 , i16* %p
30
+ %p2 = bitcast i16* %p to i32*
31
+ %load = load i32 , i32* %p2
32
+ ret i32 %load
33
+ }
34
+
21
35
define i32 @vec_store_load_first (i32* %p ) {
22
36
; CHECK-LABEL: @vec_store_load_first(
23
37
; CHECK-NEXT: [[P2:%.*]] = bitcast i32* [[P:%.*]] to <2 x i32>*
You can’t perform that action at this time.
0 commit comments