From 9f29914d4018c0c8ef2b7b7bceffb0d07483e89c Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 9 May 2017 01:14:39 +0000 Subject: Revert "Use the frame index side table for byval and inalloca arguments" This reverts r302483 and it's follow up fix. llvm-svn: 302493 --- llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index f37790d0983..8c98e3740f6 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -1150,16 +1150,16 @@ bool FastISel::selectIntrinsicCall(const IntrinsicInst *II) { return true; } - // Byval arguments with frame indices were already handled after argument - // lowering and before isel. - const auto *Arg = - dyn_cast(Address->stripInBoundsConstantOffsets()); - if (Arg && FuncInfo.getArgumentFrameIndex(Arg) != INT_MAX) - return true; - + unsigned Offset = 0; Optional Op; - if (unsigned Reg = lookUpRegForValue(Address)) - Op = MachineOperand::CreateReg(Reg, false); + if (const auto *Arg = dyn_cast(Address)) + // Some arguments' frame index is recorded during argument lowering. + Offset = FuncInfo.getArgumentFrameIndex(Arg); + if (Offset) + Op = MachineOperand::CreateFI(Offset); + if (!Op) + if (unsigned Reg = lookUpRegForValue(Address)) + Op = MachineOperand::CreateReg(Reg, false); // If we have a VLA that has a "use" in a metadata node that's then used // here but it has no other uses, then we have a problem. E.g., -- cgit v1.2.3