[PATCH] D120695: [RISCV] Move class RISCVPassConfig declaration to RISCVTargetMachine.h for downstream. NFC

Jim Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 17:55:34 PST 2022


Jim added a comment.
Herald added a project: All.

In D120695#3351508 <https://reviews.llvm.org/D120695#3351508>, @jrtc27 wrote:

> Inheriting from the pass doesn't make sense, just change the implementations. The TargetPassConfig has access to the TM for a reason. As someone with significant downstream changes I am sympathetic to changing upstream code to be more accommodating, but this change just seems motivated by an arbitrary downstream decision that goes against the intent of LLVM's structure just to avoid the occasional merge conflict (RISCVPassConfig hardly changes much).

We create a new class inherited from RISCVPassConfig and make some functions overridden to fit our need. And return our class instead of RISCVPassConfig.
Lot of behaviors between our class and RISCVPassConfig are the same. It doesn't have any change to access TM.
It is not only to avoid the occasional merge conflict. If the class RISCVPassConfig moved to RISCVTargetMachine.h, could let the dowstream reuse RISCVPassConfig in the elegant way (just include header file and inherit it, not touch upstream file much).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120695



More information about the llvm-commits mailing list