This patch fixes PR27615
@llvm.dbg.value instructions no longer count towards the maximum number of instructions to look back at in the instruction list when searching for a store instruction. This should make the output consistent between debug and non-debug build.
Details
Diff Detail
Event Timeline
Minor comments on the test, but the change itself LGTM.
test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll | ||
---|---|---|
1 | If the expectation is that the output should be exactly the same with and without debug, I'd suggest dropping the prefixes from both RUN commands and have only a single version of the check. I.e., ; CHECK: select i1 %or.cond, i32 -1, i32 5 ; CHECK-NOT: bb1: |
lib/Transforms/Utils/SimplifyCFG.cpp | ||
---|---|---|
1451 | Actually, in the original code we were doing a pre-decrement prior to the check. Now the decrement happens after the check, so I believe we're now doing one extra iteration of the loop. |
lib/Transforms/Utils/SimplifyCFG.cpp | ||
---|---|---|
1451 | Well spotted, I'll fix a patch where the initial count is reduced too so the behaviour is unchanged. | |
test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll | ||
1 | The reason why I made different checks, was to make it easier to see which run that failed. But maybe it's better to see that the tests are actually equal. |
-MaxNumInstToLookAt starts at 9 to account for the move of pre decrement
-Both test runs use same checks, to make it more clear that the output should be the same
I don't have commit access, so if you can do the commit for me that would be nice. Thanks.
Actually, in the original code we were doing a pre-decrement prior to the check. Now the decrement happens after the check, so I believe we're now doing one extra iteration of the loop.