[all-commits] [llvm/llvm-project] f946c7: [SLPVectorizer] Do Not Move Loads/Stores Beyond St...

Qiongsi Wu via All-commits all-commits at lists.llvm.org
Mon Nov 28 07:01:29 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f946c70130471baf66d668420d9a459d949e48e3
      https://github.com/llvm/llvm-project/commit/f946c70130471baf66d668420d9a459d949e48e3
  Author: Qiongsi Wu <qiongsiwu at gmail.com>
  Date:   2022-11-28 (Mon, 28 Nov 2022)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
    A llvm/test/Transforms/SLPVectorizer/X86/stackrestore-dependence.ll

  Log Message:
  -----------
  [SLPVectorizer] Do Not Move Loads/Stores Beyond Stacksave/Stackrestore Boundaries

If left unchecked, the SLPVecrtorizer can move loads/stores below a stackrestore. The move can cause issues if the loads/stores have pointer operands from `alloca`s that are reset by the stackrestores. This patch adds the dependency check.

The check is conservative, in that it does not check if the pointer operands of the loads/stores are actually from `alloca`s that may be reset. We did not observe any SPECCPU2017 performance degradation so this simple fix seems sufficient.

The test could have been added to `llvm/test/Transforms/SLPVectorizer/X86/stacksave-dependence.ll`, but that test has not been updated to use opaque pointers. I am not inclined to add tests that still use typed pointers, or to refactor `llvm/test/Transforms/SLPVectorizer/X86/stacksave-dependence.ll` to use opaque pointers in this patch. If desired, I will open a different patch to refactor and consolidate the tests.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D138585




More information about the All-commits mailing list