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

Zaara Syeda via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 7 08:40:34 PST 2024


================
@@ -632,10 +633,13 @@ void GlobalMergeImpl::setMustKeepGlobalVariables(Module &M) {
   for (Function &F : M) {
     for (BasicBlock &BB : F) {
       Instruction *Pad = BB.getFirstNonPHI();
-      if (!Pad->isEHPad())
+      auto *II = dyn_cast<IntrinsicInst>(Pad);
+      if (!Pad->isEHPad() &&
+          !(II && II->getIntrinsicID() == Intrinsic::eh_typeid_for))
         continue;
----------------
syzaara wrote:

We can't split the if statements this way since we want to continue if its neither an EHPad instruction or an Intrinsic::eh_typeid_for instruction.

Alternate could be:
```
      if (!Pad->isEHPad())
        if (auto *II = dyn_cast<IntrinsicInst>(Pad))
          if (II->getIntrinsicID() != Intrinsic::eh_typeid_for)
            continue;
```

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


More information about the llvm-commits mailing list