[PATCH] D120585: make TargetMachine visible from TargetTransformInfo
Jameson Nash via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 28 12:14:05 PST 2022
vtjnash added a comment.
Hm, I am actually not 100% certain, since I think that might be a current bug now that I think about it, which was caused by failing to expose this information about the TargetMachine. It looks some passes are adding flags there (e.g. `+thumb`/`-thumb`) with the implied assumption that they should be inheriting the global TargetMachine flags for anything left unspecified, while other passes (e.g. msan) are checking only the Function's flags, with the implied assumption that the configured TargetMachine does not specify target-features, and yet other passes (MIR/Codegen) are probably assuming that the "target-features" flag should entirely replace and override the TargetMachine's feature set. These assumptions seem currently incompatible.
For example, compare the assumptions on ARM of these:
https://github.com/llvm/llvm-project/blob/d56ef5ed20c5c1380c2d97e970c8fc4d4166bdb8/llvm/lib/Transforms/IPO/LowerTypeTests.cpp#L1418-L1424
https://github.com/llvm/llvm-project/blob/d56ef5ed20c5c1380c2d97e970c8fc4d4166bdb8/llvm/lib/Target/ARM/ARMTargetMachine.cpp#L268-L273
I am not trying to solve this here, but merely provide access to the tools (TargetMachine cpu architecture and features) so that these passes–and others like them–can be fixed.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120585/new/
https://reviews.llvm.org/D120585
More information about the llvm-commits
mailing list