JDK-8259584 : SuperWord::fix_commutative_inputs checks in_bb(fin1) instead of in_bb(fin2)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9,11,16,17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-01-11
  • Updated: 2021-02-04
  • Resolved: 2021-01-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b08Fixed
Related Reports
Relates :  
Description
SonarCloud instance reports a problem here:
"Identical sub-expressions on both sides of operator "&&"."

  bool swapped = false;

  if (in_bb(gin1) && in_bb(gin2) && in_bb(fin1) && in_bb(fin1)) { // <---- 
    if (same_origin_idx(gin1, fin1) &&
        same_origin_idx(gin2, fin2)) {
      return true; // nothing to fix
    }

I believe it should have been "in_bb(fin1) && in_bb(fin2)".

Seems to be that way since JDK-8076284.
Comments
Thanks!
02-02-2021

Done: JDK-8260943
02-02-2021

> In my opinion, code added by JDK-8076284 have to be revisited and fixed or removed in a future. Should we file an RFE for that?
02-02-2021

Changeset: 6415d3b8 Author: Vladimir Kozlov <kvn@openjdk.org> Date: 2021-01-29 16:16:14 +0000 URL: https://git.openjdk.java.net/jdk/commit/6415d3b8
29-01-2021

I am fine with suggested fix but we would not be able verify it. This code is not executed after JDK-8251994 fix: https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/superword.cpp#L519 In my opinion, code added by JDK-8076284 have to be revisited and fixed or removed in a future.
28-01-2021

Initial ILW = Wrong check in SuperWord::fix_commutative_inputs, no known issues (might only affect performance), no workaround = MMH = P3
12-01-2021

Also, the bool return of SuperWord::fix_commutative_inputs is unused.
12-01-2021