[llvm] [RISCV][SelectionDAG] Lower llvm.clear_cache to __riscv_flush_icache for glibc targets (PR #93481)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon May 27 14:15:14 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 {
----------------
arsenm wrote:
This was already a bad API and this is adding more parallel knobs. Instead, we should have an ISD node for the cache clear that legalizes in the normal way rather than trying to special case it in SelectionDAGBuilder. We can then delete these special case hooks
https://github.com/llvm/llvm-project/pull/93481
More information about the llvm-commits
mailing list