RFR: 8323582: C2 SuperWord AlignVector: misaligned vector memory access with unaligned native memory [v3]

Emanuel Peter epeter at openjdk.org
Thu Feb 20 10:35:06 UTC 2025


On Thu, 20 Feb 2025 09:44:16 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> > @rwestrel I think I had tried some verifications above, but I could not even get it to work in all cases in `SuperWord`.
> > In `VLoop::check_preconditions_helper`, I try to find either the predicate or the multiversioning if. But I cannot always find it, and I think that one reason was that the pre-loop can be lost. At least that is what I remember from 4+ weeks ago.
> 
> Do you understand when that happens? It doesn't feel right that the pre loop can be lost.

`VLoop::check_preconditions_helper` has a check like this:


  // To align vector memory accesses in the main-loop, we will have to adjust
  // the pre-loop limit.
  if (_cl->is_main_loop()) {
    CountedLoopEndNode* pre_end = _cl->find_pre_loop_end();
    if (pre_end == nullptr) {
      return VStatus::make_failure(VLoop::FAILURE_PRE_LOOP_LIMIT);
    }
    Node* pre_opaq1 = pre_end->limit();
    if (pre_opaq1->Opcode() != Op_Opaque1) {
      return VStatus::make_failure(VLoop::FAILURE_PRE_LOOP_LIMIT);
    }
    _pre_loop_end = pre_end;
  }


I don't remember exactly why the pre-loop disappears. They are rare cases. The pre-loop somehow folds away, maybe because it only has a single iteration, or just so few that it would never take the backedge.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/22016#issuecomment-2671093141


More information about the hotspot-dev mailing list