[llvm] [SandboxIR] Add utility function to find the base Value for Mem instructions (PR #112030)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 11 11:37:14 PDT 2024


================
@@ -49,6 +49,16 @@ class Utils {
     return const_cast<Instruction *>(I);
   }
 
+  /// \Returns the base Value for load or store instruction \p LSI.
+  template <typename LoadOrStoreT>
+  static Value *getMemInstructionBase(const LoadOrStoreT *LSI) {
----------------
Sterling-Augustine wrote:

Because this does more than just wrap getUnderlyingObject. It also finds the pointer operand.

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


More information about the llvm-commits mailing list