[llvm] [LICM] Improve hoisting of calls marked with invariant_load metadata (PR #193678)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 23 02:49:02 PDT 2026


================
@@ -7305,6 +7305,9 @@ bool llvm::isSafeToSpeculativelyExecuteWithOpcode(
       return false;
     const Function *Callee = CI->getCalledFunction();
 
+    // Assume we can always speculate invariant loads.
----------------
nikic wrote:

You can use speculatable on the call-site as well. It looks like the current implementation checks it only on the callee, but I think it would be fine to check on the call-site as well? At least if UseVariableInfo is enabled that should be fine I believe...

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


More information about the llvm-commits mailing list