8382054: TestLoopPeelingDisabled.java fails with -DVerifyIR=false#30713
8382054: TestLoopPeelingDisabled.java fails with -DVerifyIR=false#30713raneashay wants to merge 3 commits intoopenjdk:masterfrom
Conversation
TestLoopPeelingDisabled.java contains a test that expects an IR violation exception when loop peeling is disabled. Specifically, the test has an `@IR` annotation that checks for the presence of loop peeling phases and we expect this IR check to fail when loop peeling is disabled. But when IR checks are disabled using `-DVerifyIR=false`, the framework skips checking the annotation, resulting in no IR violation exception, causing the test to fail. This patch adds a guard so that only when `VerifyIR` is set that we look for the IR violation exception. Credit to Tobias Hartmann for discovering and reporing the issue.
|
👋 Welcome back raneashay! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@raneashay The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
dafedafe
left a comment
There was a problem hiding this comment.
LGTM. Thanks @raneashay. Just running some testing...
| // Then, run the same test with loop peeling disabled, which should | ||
| // elide the {BEFORE,AFTER}_LOOP_PEELING compilation phases, causing the | ||
| // test to throw an IRViolationException. We then check whether the | ||
| // test to throw an IRViolationException. We then check whether the |
There was a problem hiding this comment.
| // test to throw an IRViolationException. We then check whether the | |
| // test to throw an IRViolationException. We then check whether the |
| // Then, run the same test with loop peeling disabled, which should | ||
| // elide the {BEFORE,AFTER}_LOOP_PEELING compilation phases, causing the | ||
| // test to throw an IRViolationException. We then check whether the | ||
| // test to throw an IRViolationException. We then check whether the |
There was a problem hiding this comment.
| // test to throw an IRViolationException. We then check whether the | |
| // test to throw an IRViolationException. We then check whether the |
| Asserts.fail("Unexpected IR violation: " + info); | ||
| } | ||
| System.out.println("Loop peeling correctly disabled"); | ||
| // phase was not found). If IR verification is disabled, this test will |
There was a problem hiding this comment.
| // phase was not found). If IR verification is disabled, this test will | |
| // phase was not found). If IR verification is disabled, this test will |
| } | ||
| System.out.println("Loop peeling correctly disabled"); | ||
| // phase was not found). If IR verification is disabled, this test will | ||
| // not throw IRViolationException. |
There was a problem hiding this comment.
| // not throw IRViolationException. | |
| // not throw an IRViolationException. |
| if (Boolean.parseBoolean(System.getProperty("VerifyIR", "true"))) { | ||
| try { | ||
| TestFramework.runWithFlags("-XX:+UnlockDiagnosticVMOptions", | ||
| "-XX:LoopPeeling=0"); | ||
| Asserts.fail("Expected IRViolationException"); | ||
| } catch (IRViolationException e) { | ||
| String info = e.getExceptionInfo(); | ||
| if (!info.contains("NO compilation output found for this phase")) { | ||
| Asserts.fail("Unexpected IR violation: " + info); | ||
| } | ||
| System.out.println("Loop peeling correctly disabled"); | ||
| } | ||
| } |
There was a problem hiding this comment.
This will only execute the test with LoopPeeling=0 if VerifyIR is true. But we should also execute it if VerifyIR is false. A better fix could be:
| if (Boolean.parseBoolean(System.getProperty("VerifyIR", "true"))) { | |
| try { | |
| TestFramework.runWithFlags("-XX:+UnlockDiagnosticVMOptions", | |
| "-XX:LoopPeeling=0"); | |
| Asserts.fail("Expected IRViolationException"); | |
| } catch (IRViolationException e) { | |
| String info = e.getExceptionInfo(); | |
| if (!info.contains("NO compilation output found for this phase")) { | |
| Asserts.fail("Unexpected IR violation: " + info); | |
| } | |
| System.out.println("Loop peeling correctly disabled"); | |
| } | |
| } | |
| try { | |
| TestFramework.runWithFlags("-XX:+UnlockDiagnosticVMOptions", | |
| "-XX:LoopPeeling=0"); | |
| Asserts.assertFalse(Boolean.parseBoolean(System.getProperty("VerifyIR", "true")), | |
| "Expected IRViolationException when performing IR matching"); | |
| } catch (IRViolationException e) { | |
| String info = e.getExceptionInfo(); | |
| if (!info.contains("NO compilation output found for this phase")) { | |
| Asserts.fail("Unexpected IR violation: " + info); | |
| } | |
| System.out.println("Loop peeling correctly disabled"); | |
| } |
The key change is that instead of not running the test at all when verifyIR is false, we now run the test unconditionally and throw an assertion only if verifyIR is false AND if we didn't catch IRViolationException.
|
Thanks @dafedafe and @chhagedorn! I've updated the patch to include your suggestions. |
TestLoopPeelingDisabled.java contains a test that expects an IR
violation exception when loop peeling is disabled. Specifically, the
test has an
@IRannotation that checks for the presence of looppeeling phases and we expect this IR check to fail when loop peeling is
disabled. But when IR checks are disabled using
-DVerifyIR=false, theframework skips checking the annotation, resulting in no IR violation
exception, causing the test to fail.
This patch adds a guard so that only when
VerifyIRis set that we lookfor the IR violation exception.
Credit to Tobias Hartmann for discovering and reporing the issue.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30713/head:pull/30713$ git checkout pull/30713Update a local copy of the PR:
$ git checkout pull/30713$ git pull https://git.openjdk.org/jdk.git pull/30713/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 30713View PR using the GUI difftool:
$ git pr show -t 30713Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30713.diff
Using Webrev
Link to Webrev Comment