[PATCH] D143665: [Clang][RISCV] Guard vector int64, float32, float64 with semantic analysis

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 9 13:37:10 PST 2023


craig.topper added inline comments.


================
Comment at: clang/include/clang/AST/Type.h:7209
 
+inline bool Type::isVectorFloat32Type() const {
+#define RVV_TYPE(Name, Id, SingletonId) false ||
----------------
This function is RVV specific so it's name is misleading. It's also identical to the isRVVFloat32Type function


================
Comment at: clang/include/clang/Basic/TargetInfo.h:668
+  /// Determine whether vector int64 type is supported on this target.
+  virtual bool hasVectorInt64Support() const { return false; }
+
----------------
Having a different virtual method for each type doesn't scale well. Could we have a single function that take the bitwidth and a bool for int or FP?

It's also very misleading based on the current names to return false for targets like X86 that do support float32 and float64.

Overall it might be cleaner to call S.Context.getTargetInfo().hasFeature( from  RISCV-V specific code in Sema instead of trying to define a generic interface.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143665



More information about the cfe-commits mailing list