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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 7 06:19:45 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,
----------------
nikic wrote:

Yeah, I think it would be cleaner with one method and a boolean flag instead of two methods.

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


More information about the llvm-commits mailing list