[llvm] [RFC][CodeGen] Add generic target feature checks for intrinsics (PR #201470)
Pierre van Houtryve via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 4 05:26:55 PDT 2026
Pierre-vh wrote:
> Right, but I generally prefer not to use mutable, since it often indicates a layering violation or a design issue. In this particular case
I'd only see an issue with mutable if used to implement some functionality, e.g. the results returned by the function would be different if that mutable state was not present.
mutable is entirely fine if it's used only to cache/improve performance.
> TargetSubtargetInfo doesn't own any data members today, so I'd rather not introduce a mutable one unless there's a strong reason to do so.
Its parent class already has data members so I don't think it's a big issue to introduce one in TargetSubtargetInfo as well.
That said, I think the first step is just to do profiling and check if this is even a measurable performance impact.
https://github.com/llvm/llvm-project/pull/201470
More information about the llvm-commits
mailing list