[PATCH] D156680: AMDGPU: Don't store current instruction in AMDGPULibCalls member

Juan Manuel Martinez CaamaƱo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 05:30:04 PDT 2023


jmmartinez added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp:113-120
+  void replaceCall(Instruction *I, Value *With) {
+    I->replaceAllUsesWith(With);
+    I->eraseFromParent();
+  }
+
+  void replaceCall(FPMathOperator *I, Value *With) {
+    replaceCall(cast<Instruction>(I), With);
----------------
What do you think about making the functions static members ?

NIT: [ReplaceInstWithInst](https://llvm.org/doxygen/namespacellvm.html#a4689c154d8eac4af62d37059c9898e6d) also takes the name. Maybe we could use that function instead of the two calls?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156680/new/

https://reviews.llvm.org/D156680



More information about the llvm-commits mailing list