Details
- Reviewers
dschuff - Commits
- rG44718c5ef2c5: [WebAssembly] Use CHECK-NEXT for irreducible-cfg.mir
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This change looks fine to me, but have you considered just moving this test over to using update_mir_test_checks.py? It's ever so slightly more verbose, but in my experience reviewing changes that change test output are so much easier as you can just see the git diff of old vs new.
Doing so would generate this CHECK block:
+ ; CHECK-LABEL: name: test0 + ; CHECK: bb.0.pred0: + ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: [[CONST_I32_:%[0-9]+]]:i32 = CONST_I32 100, implicit-def $arguments + ; CHECK-NEXT: BR_IF %bb.2, [[CONST_I32_]], implicit-def $arguments + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.1.pred1: + ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.7(0x40000000) + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: BR_IF %bb.7, [[CONST_I32_]], implicit-def $arguments + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.2: + ; CHECK-NEXT: successors: %bb.6(0x80000000) + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: [[CONST_I32_1:%[0-9]+]]:i32 = CONST_I32 0, implicit-def $arguments + ; CHECK-NEXT: BR %bb.6, implicit-def $arguments + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.3.entry0: + ; CHECK-NEXT: successors: %bb.4(0x80000000) + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: BR %bb.4, implicit-def $arguments + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.4: + ; CHECK-NEXT: successors: %bb.6(0x80000000) + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: [[CONST_I32_2:%[0-9]+]]:i32 = CONST_I32 1, implicit-def $arguments + ; CHECK-NEXT: BR %bb.6, implicit-def $arguments + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.5.entry1: + ; CHECK-NEXT: successors: %bb.8(0x80000000) + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: BR %bb.8, implicit-def $arguments + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.6: + ; CHECK-NEXT: successors: %bb.3(0x40000000), %bb.5(0x40000000) + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: BR_TABLE_I32 [[CONST_I32_2]], %bb.3, %bb.5, %bb.5, implicit-def $arguments + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.7: + ; CHECK-NEXT: successors: %bb.6(0x80000000) + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: [[CONST_I32_2:%[0-9]+]]:i32 = CONST_I32 1, implicit-def $arguments + ; CHECK-NEXT: BR %bb.6, implicit-def $arguments + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.8: + ; CHECK-NEXT: successors: %bb.6(0x80000000) + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: [[CONST_I32_2:%[0-9]+]]:i32 = CONST_I32 0, implicit-def $arguments + ; CHECK-NEXT: BR %bb.6, implicit-def $arguments
The script doesn't generate CHECK lines next to each BB but rather generates the whole function together, making it harder to see changes in each BB for me. Also there are comments for CHECK lines, which will be lost if we use the script. So I'm not sure using it will improve readability in this case.
This looks good. Keep the interleaving if you find it more readable.
But thanks for the pointer @asb, I knew about the LLVM IR version of that tool but didn't know there was a MIR one.