[PATCH] D46482: [ObjCARC] Prevent code motion into a catchswitch

Akira Hatanaka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 15 10:11:13 PDT 2018


ahatanak added inline comments.


================
Comment at: lib/Transforms/ObjCARC/ObjCARCOpts.cpp:1577
       const RRInfo &NewRetainRRI = It->second;
       KnownSafeTD &= NewRetainRRI.KnownSafe;
       for (Instruction *NewRetainRelease : NewRetainRRI.Calls) {
----------------
If you want to set CFGHazardAfflicted inside BottomUpPtrState::HandlePotentialUse, perhaps you can read NewRetainRRI's CFGHazardAfflicted bit and set CFGHazardAfflicted here, just as it's done in line 1649?


================
Comment at: lib/Transforms/ObjCARC/ObjCARCOpts.cpp:1699
+                CFGHazardAfflicted |= isa<CatchSwitchInst>(RIP);
               }
             }
----------------
This is preventing releases from being inserted before a CatchSwitchInst. Is that correct? Do you have to prevent retains from being inserted before CatchSwitchInsts too somewhere, or we don't have to worry about it because it never happens?


Repository:
  rL LLVM

https://reviews.llvm.org/D46482





More information about the llvm-commits mailing list