[llvm] [RISCV][SelectionDAG] Lower llvm.clear_cache to __riscv_flush_icache for glibc targets (PR #93481)

Roger Ferrer Ibáñez via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 02:55:10 PDT 2024


================
@@ -4764,8 +4764,15 @@ class TargetLowering : public TargetLoweringBase {
     return false;
   }
 
+  /// Returns true if the target needs to lower __builtin___clear_cache in a
+  /// specific way that is incompatible with the clear_cache
+  /// signature. When returning false, the lowering will invoke
+  /// getClearCacheBuiltinName.
+  virtual bool isClearCacheBuiltinTargetSpecific() const { return false; }
+
   /// Return the builtin name for the __builtin___clear_cache intrinsic
-  /// Default is to invoke the clear cache library call
+  /// This is only used if isClearCacheBuiltinTargetSpecific returns false.
+  /// If nullptr is returned, the builtin is lowered to no code.
   virtual const char * getClearCacheBuiltinName() const {
----------------
rofirrim wrote:

Fair, let's discuss the groundwork at https://github.com/llvm/llvm-project/pull/93795

https://github.com/llvm/llvm-project/pull/93481


More information about the llvm-commits mailing list