| OLD | NEW |
| 1 ; This is a smoke test of constant blinding and constant pooling. | 1 ; This is a smoke test of constant blinding and constant pooling. |
| 2 | 2 |
| 3 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ | 3 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ |
| 4 ; RUN: -sz-seed=1 -randomize-pool-immediates=randomize \ | 4 ; RUN: -sz-seed=1 -randomize-pool-immediates=randomize \ |
| 5 ; RUN: -randomize-pool-threshold=0x1 \ | 5 ; RUN: -randomize-pool-threshold=0x1 \ |
| 6 ; RUN: | FileCheck %s --check-prefix=BLINDINGO2 | 6 ; RUN: | FileCheck %s --check-prefix=BLINDINGO2 |
| 7 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ | 7 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ |
| 8 ; RUN: -sz-seed=1 -randomize-pool-immediates=randomize \ | 8 ; RUN: -sz-seed=1 -randomize-pool-immediates=randomize \ |
| 9 ; RUN: -randomize-pool-threshold=0x1 \ | 9 ; RUN: -randomize-pool-threshold=0x1 \ |
| 10 ; RUN: | FileCheck %s --check-prefix=BLINDINGOM1 | 10 ; RUN: | FileCheck %s --check-prefix=BLINDINGOM1 |
| 11 | 11 |
| 12 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ | 12 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ |
| 13 ; RUN: -sz-seed=1 -randomize-pool-immediates=pool \ | 13 ; RUN: -sz-seed=1 -randomize-pool-immediates=pool \ |
| 14 ; RUN: -randomize-pool-threshold=0x1 \ | 14 ; RUN: -randomize-pool-threshold=0x1 \ |
| 15 ; RUN: | FileCheck %s --check-prefix=POOLING | 15 ; RUN: | FileCheck %s --check-prefix=POOLING |
| 16 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ | 16 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ |
| 17 ; RUN: -sz-seed=1 -randomize-pool-immediates=pool \ | 17 ; RUN: -sz-seed=1 -randomize-pool-immediates=pool \ |
| 18 ; RUN: -randomize-pool-threshold=0x1 \ | 18 ; RUN: -randomize-pool-threshold=0x1 \ |
| 19 ; RUN: | FileCheck %s --check-prefix=POOLING | 19 ; RUN: | FileCheck %s --check-prefix=POOLING |
| 20 | 20 |
| 21 | 21 |
| 22 define i32 @add_arg_plus_200000(i32 %arg) { | 22 define internal i32 @add_arg_plus_200000(i32 %arg) { |
| 23 entry: | 23 entry: |
| 24 %res = add i32 200000, %arg | 24 %res = add i32 200000, %arg |
| 25 ret i32 %res | 25 ret i32 %res |
| 26 | 26 |
| 27 ; BLINDINGO2-LABEL: add_arg_plus_200000 | 27 ; BLINDINGO2-LABEL: add_arg_plus_200000 |
| 28 ; BLINDINGO2: mov [[REG:e[a-z]*]],0x669f4eea | 28 ; BLINDINGO2: mov [[REG:e[a-z]*]],0x669f4eea |
| 29 ; BLINDINGO2-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x669c41aa{{[]]}} | 29 ; BLINDINGO2-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x669c41aa{{[]]}} |
| 30 | 30 |
| 31 ; BLINDINGOM1-LABEL: add_arg_plus_200000 | 31 ; BLINDINGOM1-LABEL: add_arg_plus_200000 |
| 32 ; BLINDINGOM1: mov [[REG:e[a-z]*]],0x669f4eea | 32 ; BLINDINGOM1: mov [[REG:e[a-z]*]],0x669f4eea |
| 33 ; BLINDINGOM1-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x669c41aa{{[]]}} | 33 ; BLINDINGOM1-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x669c41aa{{[]]}} |
| 34 | 34 |
| 35 ; POOLING-LABEL: add_arg_plus_200000 | 35 ; POOLING-LABEL: add_arg_plus_200000 |
| 36 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32$00030
d40 | 36 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32$00030
d40 |
| 37 } | 37 } |
| 38 | 38 |
| 39 define float @load_arg_plus_200000(float* %arg) { | 39 define internal float @load_arg_plus_200000(float* %arg) { |
| 40 entry: | 40 entry: |
| 41 %arg.int = ptrtoint float* %arg to i32 | 41 %arg.int = ptrtoint float* %arg to i32 |
| 42 %addr.int = add i32 %arg.int, 200000 | 42 %addr.int = add i32 %arg.int, 200000 |
| 43 %addr.ptr = inttoptr i32 %addr.int to float* | 43 %addr.ptr = inttoptr i32 %addr.int to float* |
| 44 %addr.load = load float, float* %addr.ptr, align 4 | 44 %addr.load = load float, float* %addr.ptr, align 4 |
| 45 ret float %addr.load | 45 ret float %addr.load |
| 46 ; BLINDINGO2-LABEL: load_arg_plus_200000 | 46 ; BLINDINGO2-LABEL: load_arg_plus_200000 |
| 47 ; BLINDINGO2: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}+0x69ed4ee7{{[]]}} | 47 ; BLINDINGO2: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}+0x69ed4ee7{{[]]}} |
| 48 | 48 |
| 49 ; BLINDINGOM1-LABEL: load_arg_plus_200000 | 49 ; BLINDINGOM1-LABEL: load_arg_plus_200000 |
| 50 ; BLINDINGOM1: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}-0x69ea41a7{{[]]}} | 50 ; BLINDINGOM1: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}-0x69ea41a7{{[]]}} |
| 51 | 51 |
| 52 ; POOLING-LABEL: load_arg_plus_200000 | 52 ; POOLING-LABEL: load_arg_plus_200000 |
| 53 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32$00030
d40 | 53 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32$00030
d40 |
| 54 } | 54 } |
| 55 | 55 |
| 56 define i64 @add_arg_plus_64bits(i32 %arg) { | 56 define internal i64 @add_arg_plus_64bits(i32 %arg) { |
| 57 entry: | 57 entry: |
| 58 %0 = sext i32 %arg to i64 | 58 %0 = sext i32 %arg to i64 |
| 59 %res = add i64 90000000000, %0 | 59 %res = add i64 90000000000, %0 |
| 60 ret i64 %res | 60 ret i64 %res |
| 61 | 61 |
| 62 ; BLINDINGO2-LABEL: add_arg_plus_64bits | 62 ; BLINDINGO2-LABEL: add_arg_plus_64bits |
| 63 ; BLINDINGO2: sar [[RHI:e[a-z]*]],0x1f | 63 ; BLINDINGO2: sar [[RHI:e[a-z]*]],0x1f |
| 64 ; BLINDINGO2: mov [[RLO:e[a-z]*]],0x61a345a8 | 64 ; BLINDINGO2: mov [[RLO:e[a-z]*]],0x61a345a8 |
| 65 ; BLINDINGO2-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x6d3841a8{{[]]}} | 65 ; BLINDINGO2-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x6d3841a8{{[]]}} |
| 66 | 66 |
| 67 ; BLINDINGOM1-LABEL: add_arg_plus_64bits | 67 ; BLINDINGOM1-LABEL: add_arg_plus_64bits |
| 68 ; BLINDINGOM1: sar [[RHI:e[a-z]*]],0x1f | 68 ; BLINDINGOM1: sar [[RHI:e[a-z]*]],0x1f |
| 69 ; BLINDINGOM1: mov [[RLO:e[a-z]*]],0x61a345a8 | 69 ; BLINDINGOM1: mov [[RLO:e[a-z]*]],0x61a345a8 |
| 70 ; BLINDINGOM1-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x6d3841a8{{[]]}} | 70 ; BLINDINGOM1-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x6d3841a8{{[]]}} |
| 71 | 71 |
| 72 ; POOLING-LABEL: add_arg_plus_64bits | 72 ; POOLING-LABEL: add_arg_plus_64bits |
| 73 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32$f46b0
400 | 73 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32$f46b0
400 |
| 74 } | 74 } |
| 75 | 75 |
| 76 define i64 @load_arg_plus_64bits(i64* %arg) { | 76 define internal i64 @load_arg_plus_64bits(i64* %arg) { |
| 77 entry: | 77 entry: |
| 78 %arg.int = ptrtoint i64* %arg to i32 | 78 %arg.int = ptrtoint i64* %arg to i32 |
| 79 %arg.new = add i32 %arg.int, 90000 | 79 %arg.new = add i32 %arg.int, 90000 |
| 80 %arg.ptr = inttoptr i32 %arg.new to i64* | 80 %arg.ptr = inttoptr i32 %arg.new to i64* |
| 81 %arg.load = load i64, i64* %arg.ptr, align 1 | 81 %arg.load = load i64, i64* %arg.ptr, align 1 |
| 82 ret i64 %arg.load | 82 ret i64 %arg.load |
| 83 | 83 |
| 84 ; BLINDINGO2-LABEL: load_arg_plus_64bits | 84 ; BLINDINGO2-LABEL: load_arg_plus_64bits |
| 85 ; BLINDINGO2: lea e{{[a-z]*}},{{[[]}}e{{[a-z]*}}+0x7087a139{{[]]}} | 85 ; BLINDINGO2: lea e{{[a-z]*}},{{[[]}}e{{[a-z]*}}+0x7087a139{{[]]}} |
| 86 ; BLINDINGO2: mov e{{[a-z]*}},DWORD PTR {{[[]}}e{{[a-z]*}}-0x708641a9{{[]]}} | 86 ; BLINDINGO2: mov e{{[a-z]*}},DWORD PTR {{[[]}}e{{[a-z]*}}-0x708641a9{{[]]}} |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 ; BLINDINGO2-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x772241a7{{[]]}} | 124 ; BLINDINGO2-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x772241a7{{[]]}} |
| 125 | 125 |
| 126 ; BLINDINGOM1-LABEL: add_const_16bits | 126 ; BLINDINGOM1-LABEL: add_const_16bits |
| 127 ; BLINDINGOM1: mov e{{[a-z]*}},0x7722c1a5 | 127 ; BLINDINGOM1: mov e{{[a-z]*}},0x7722c1a5 |
| 128 ; BLINDINGOM1-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x772241a7{{[]]}} | 128 ; BLINDINGOM1-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x772241a7{{[]]}} |
| 129 | 129 |
| 130 ; POOLING-LABEL: add_const_16bits | 130 ; POOLING-LABEL: add_const_16bits |
| 131 ; POOLING: mov {{[a-z]x}},WORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i16$00007ff
e | 131 ; POOLING: mov {{[a-z]x}},WORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i16$00007ff
e |
| 132 | 132 |
| 133 } | 133 } |
| OLD | NEW |