Anastasis Grammenos | d6c6678 | 2018-05-17 18:19:58 +0000 | [diff] [blame] | 1 | ; RUN: opt -debugify-each -O3 -S -o /dev/null < %s 2> %t |
Vedant Kumar | 5c6b3fb | 2018-05-16 17:30:58 +0000 | [diff] [blame] | 2 | ; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS |
| 3 | ; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS |
Fangrui Song | 98b9338 | 2020-11-02 08:16:43 -0800 | [diff] [blame] | 4 | ; RUN: opt -disable-output -debugify-each -passes='default<O3>' %s 2> %t |
| 5 | ; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS |
| 6 | ; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS |
Vedant Kumar | 5c6b3fb | 2018-05-16 17:30:58 +0000 | [diff] [blame] | 7 | |
Anastasis Grammenos | d6c6678 | 2018-05-17 18:19:58 +0000 | [diff] [blame] | 8 | ; RUN: opt -enable-debugify -debugify-each -O3 -S -o /dev/null < %s 2> %t |
Vedant Kumar | 5c6b3fb | 2018-05-16 17:30:58 +0000 | [diff] [blame] | 9 | ; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS |
| 10 | ; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS |
| 11 | |
Anastasis Grammenos | d6c6678 | 2018-05-17 18:19:58 +0000 | [diff] [blame] | 12 | ; RUN: opt -debugify-each -instrprof -instrprof -sroa -sccp -S -o /dev/null < %s 2> %t |
Vedant Kumar | 5c6b3fb | 2018-05-16 17:30:58 +0000 | [diff] [blame] | 13 | ; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS |
| 14 | ; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS |
Vedant Kumar | 595ba1d | 2018-05-15 00:29:27 +0000 | [diff] [blame] | 15 | |
Anastasis Grammenos | d6c6678 | 2018-05-17 18:19:58 +0000 | [diff] [blame] | 16 | ; Verify that debugify each can be safely used with piping |
| 17 | ; RUN: opt -debugify-each -O1 < %s | opt -O2 -o /dev/null |
| 18 | |
Vedant Kumar | a9e2731 | 2018-06-06 19:05:41 +0000 | [diff] [blame] | 19 | ; Check that the quiet mode emits no messages. |
| 20 | ; RUN: opt -disable-output -debugify-quiet -debugify-each -O1 < %s 2>&1 | count 0 |
| 21 | |
Vedant Kumar | adbd27a | 2018-06-04 00:11:49 +0000 | [diff] [blame] | 22 | ; Check that stripped textual IR compares equal before and after applying |
| 23 | ; debugify. |
Vedant Kumar | 122a6bf | 2020-04-10 14:58:13 -0700 | [diff] [blame] | 24 | ; RUN: opt -O1 < %s -S -o %t.before |
| 25 | ; RUN: opt -O1 -debugify-each < %s -S -o %t.after |
Vedant Kumar | adbd27a | 2018-06-04 00:11:49 +0000 | [diff] [blame] | 26 | ; RUN: diff %t.before %t.after |
| 27 | |
| 28 | ; Check that stripped IR compares equal before and after applying debugify. |
Vedant Kumar | 122a6bf | 2020-04-10 14:58:13 -0700 | [diff] [blame] | 29 | ; RUN: opt -O1 < %s | llvm-dis -o %t.before |
| 30 | ; RUN: opt -O1 -debugify-each < %s | llvm-dis -o %t.after |
Vedant Kumar | adbd27a | 2018-06-04 00:11:49 +0000 | [diff] [blame] | 31 | ; RUN: diff %t.before %t.after |
| 32 | |
Arthur Eubanks | 7de6dcd | 2020-11-16 11:47:50 -0800 | [diff] [blame] | 33 | ; Check that we only run debugify once per function per function pass. |
| 34 | ; This ensures that we don't run it for pass managers/verifiers/printers. |
| 35 | ; RUN: opt -debugify-each -passes=instsimplify -S -o /dev/null < %s 2> %t |
| 36 | ; RUN: FileCheck %s -input-file=%t -check-prefix=FUNCTION-PASS-ONE |
| 37 | |
| 38 | ; Check that we only run debugify once per module pass |
| 39 | ; (plus the implicitly added begin/end verifier passes). |
| 40 | ; RUN: opt -debugify-each -passes=globalopt -S -o /dev/null < %s 2> %t |
| 41 | ; RUN: FileCheck %s -input-file=%t -check-prefix=MODULE-PASS-ONE |
| 42 | |
Vedant Kumar | adbd27a | 2018-06-04 00:11:49 +0000 | [diff] [blame] | 43 | define void @foo(i32 %arg) { |
| 44 | call i32 asm "bswap $0", "=r,r"(i32 %arg) |
Vedant Kumar | 595ba1d | 2018-05-15 00:29:27 +0000 | [diff] [blame] | 45 | ret void |
| 46 | } |
| 47 | |
| 48 | define void @bar() { |
| 49 | ret void |
| 50 | } |
| 51 | |
| 52 | ; Verify that the module & function (check-)debugify passes run at least twice. |
| 53 | |
Vedant Kumar | 5c6b3fb | 2018-05-16 17:30:58 +0000 | [diff] [blame] | 54 | ; MODULE-PASS: CheckModuleDebugify [{{.*}}] |
| 55 | ; MODULE-PASS: CheckModuleDebugify [{{.*}}] |
Vedant Kumar | 595ba1d | 2018-05-15 00:29:27 +0000 | [diff] [blame] | 56 | |
Vedant Kumar | 5c6b3fb | 2018-05-16 17:30:58 +0000 | [diff] [blame] | 57 | ; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}] |
| 58 | ; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}] |
| 59 | ; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}] |
| 60 | ; FUNCTION-PASS: CheckFunctionDebugify [{{.*}}] |
Arthur Eubanks | 7de6dcd | 2020-11-16 11:47:50 -0800 | [diff] [blame] | 61 | |
| 62 | ; MODULE-PASS-ONE: CheckModuleDebugify [{{.*}}] |
| 63 | ; MODULE-PASS-ONE-NOT: CheckModuleDebugify [{{.*}}] |
| 64 | |
| 65 | ; FUNCTION-PASS-ONE: CheckFunctionDebugify [{{.*}}] |
| 66 | ; FUNCTION-PASS-ONE: CheckFunctionDebugify [{{.*}}] |
| 67 | ; FUNCTION-PASS-ONE-NOT: CheckFunctionDebugify [{{.*}}] |