[llvm] [PPC] Replace PPCMergeStringPool with GlobalMerge for Linux (PR #114850)

Stefan Pintilie via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 12:54:41 PST 2024


================
@@ -713,6 +714,24 @@ bool GlobalMergeImpl::run(Module &M) {
     // Ignore all "required" globals:
     if (isMustKeepGlobalVariable(&GV))
       continue;
+    auto checkUsers = [] (const GlobalVariable *GV) {
+      for (const User *CurrentUser : GV->users()) {
+        if (auto *I = dyn_cast<Instruction>(CurrentUser)) {
----------------
stefanp-ibm wrote:

nit:
Maybe we can flatten this `if` statement.
```
auto *I = dyn_cast<Instruction>(CurrentUser);
if (!I)
  continue;
  <rest of code...>
```

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


More information about the llvm-commits mailing list