[PATCH] D152282: [Transforms][LICM] A test case for the upcoming fix D152281 for the issue with reassociation profitability

Paul Osmialowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 06:08:26 PDT 2023


pawosm01 marked an inline comment as done.
pawosm01 added inline comments.


================
Comment at: llvm/test/Transforms/LICM/expr-reassociate.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
+; RUN: opt -passes='reassociate' -S < %s | FileCheck %s --check-prefix=REASSOCIATE_ONLY
+; RUN: opt -passes='licm' -S < %s | FileCheck %s --check-prefix=LICM_ONLY
----------------
fhahn wrote:
> Usually the tests for a specific transform shouldn't depend on other passes; You could add a test to `PhaseOrdering` that tests the end-to-end flow (e.g. with -O2) and then here have just the ones that run `licm` on the input IR that requires reassoication to move it out of the loop
I was about to move a vital part of this test into the `Transforms/PhaseOrdering` but I was encouraged not to. The test as it is now captures the interplay between those two passes quite well and is self-contained. Those end-to-end tests are pretty rare.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152282/new/

https://reviews.llvm.org/D152282



More information about the llvm-commits mailing list