[TableGen] Split DAGISelMatcherOpt FactorNodes into 2 functions. NFC (#125330)
[llvm-project.git] / llvm / test / CodeGen / Hexagon / widen-not-load.ll
blob630ddc57a4c5ac25460d4fb5e5eeefa01a4e2702
1 ; Test that double word post increment load is not generated.
2 ; REQUIRES: asserts
4 ; REQUIRES: asserts
5 ; RUN: llc -mtriple=hexagon -O2 -debug-only=hexagon-load-store-widening \
6 ; RUN:      %s -o 2>&1 - | FileCheck %s
8 ; Loads with positive invalid postinc is not widened
9 define ptr @test1() {
10 ; CHECK-LABEL: test1
11 ; CHECK-NOT: memd(r{{[0-9]+}}++
12 entry:
13   %0 = load ptr, ptr null, align 4
14   %b = getelementptr i8, ptr %0, i32 20
15   %1 = load i32, ptr %0, align 8
16   %c = getelementptr i8, ptr %0, i32 4
17   %2 = load i32, ptr %c, align 4
18   %call55 = call i8 @foo(ptr %b, i32 %1, i32 %2)
19   ret ptr null
22 ; Loads with negative invalid postinc is not widened
23 define ptr @test2() {
24 ; CHECK-LABEL: test2
25 ; CHECK-NOT: memd(r{{[0-9]+}}++
26 entry:
27   %0 = load ptr, ptr null, align 4
28   %b = getelementptr i8, ptr %0, i32 -20
29   %1 = load i32, ptr %0, align 8
30   %c = getelementptr i8, ptr %0, i32 4
31   %2 = load i32, ptr %c, align 4
32   %call55 = call i8 @foo(ptr %b, i32 %1, i32 %2)
33   ret ptr null
36 ; Loads with valid positive postinc is widened
37 define ptr @test3() {
38 ; CHECK-LABEL: test3
39 ; CHECK: memd
40 entry:
41   %0 = load ptr, ptr null, align 4
42   %b = getelementptr i8, ptr %0, i32 24
43   %1 = load i32, ptr %0, align 8
44   %c = getelementptr i8, ptr %0, i32 4
45   %2 = load i32, ptr %c, align 4
46   %call55 = call i8 @foo(ptr %b, i32 %1, i32 %2)
47   ret ptr null
50 ; Loads with valid negative postinc is widened
51 define ptr @test4() {
52 ; CHECK-LABEL: test4
53 ; CHECK: memd
54 entry:
55   %0 = load ptr, ptr null, align 4
56   %b = getelementptr i8, ptr %0, i32 -24
57   %1 = load i32, ptr %0, align 8
58   %c = getelementptr i8, ptr %0, i32 4
59   %2 = load i32, ptr %c, align 4
60   %call55 = call i8 @foo(ptr %b, i32 %1, i32 %2)
61   ret ptr null
64 declare i8 @foo(ptr, i32, i32)