[PATCH] D106503: MCSubtargetInfo: Add debugging 'features' that dump current CPU bit state

George Burgess IV via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 26 17:13:05 PDT 2021


george.burgess.iv added a comment.

> I'm curious, as X86 is probably one of the more complicated targets, does rust make use of llvm::X86::updateImpliedFeatures and llvm::X86::getFeaturesForCPU from llvm/lib/Support/X86TargetParser.cpp? That's a large chunk of the code clang uses for feature interactions.

`ripgrep` says Rust never tries to directly invoke either of these. Should it? I'm not personally an expert in backend features, but it seems slightly odd to me that frontends should need to query this info when LLVM already infers much about backend features on its own.

FWIW, I noticed that the inference of SGX is missing from a few `rustc` invocations for certain X86 target CPUs (well, missing compared to clang, at least). Seems like that could be because Rust doesn't call the functions you mentioned. Do you think that should be a bug against `rustc`, or against LLVM for not realizing that SGX is a feature of some CPUs except through these `llvm::X86::{updateImpliedFeatures,getFeaturesForCPU}` interfaces?


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

https://reviews.llvm.org/D106503



More information about the llvm-commits mailing list