[llvm] Provide intrinsics for speculative loads (PR #179642)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 4 03:46:24 PST 2026


================
@@ -131,6 +131,42 @@ static bool lowerLoadRelative(Function &F) {
   return Changed;
 }
 
+/// Lower @llvm.can.load.speculatively using target-specific expansion.
+/// Each target provides its own expansion via
+/// TargetLowering::emitCanLoadSpeculatively.
+/// The default expansion returns false (conservative).
+static bool lowerCanLoadSpeculatively(Function &F, const TargetMachine *TM) {
+  if (F.use_empty())
+    return false;
+
----------------
arsenm wrote:

Don't need this 

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


More information about the llvm-commits mailing list