[llvm] [EarlyCSE, TTI] Don't create new, unused, instructions. (PR #134534)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 6 20:13:05 PDT 2025


================
@@ -1690,9 +1690,16 @@ class TargetTransformInfo {
   /// unordered-atomic memory intrinsic.
   LLVM_ABI unsigned getAtomicMemIntrinsicMaxElementSize() const;
 
+  /// \returns A value which is the result of the given memory intrinsic.
+  /// Returns nullptr if the target cannot return a result from the given
+  /// intrinsic, e.g. because it would require creating new instructions. Use
+  /// getOrCreateResultFromMemIntrinsic to allow creating new instructions.
+  LLVM_ABI Value *getResultFromMemIntrinsic(IntrinsicInst *Inst,
----------------
arsenm wrote:

Can we avoid having 2 nearly identical functions to implement 

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


More information about the llvm-commits mailing list