[llvm-branch-commits] [clang] Move {load, store}(llvm.protected.field.ptr) lowering to InstCombine. (PR #186548)

Nikita Popov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Mar 16 12:19:20 PDT 2026


================
@@ -700,7 +700,8 @@ static bool isSafeAndProfitableToSinkLoad(LoadInst *L) {
 Instruction *InstCombinerImpl::foldPHIArgLoadIntoPHI(PHINode &PN) {
   LoadInst *FirstLI = cast<LoadInst>(PN.getIncomingValue(0));
 
-  if (!canReplaceOperandWithVariable(FirstLI, 0))
+  // Can't forward swifterror through a phi.
+  if (FirstLI->getOperand(0)->isSwiftError())
----------------
nikic wrote:

I think it would be better to keep this code as-is.

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


More information about the llvm-branch-commits mailing list