[llvm] r195944 - Refactor a lot of patchpoint/stackmap related code to simplify and make it

Juergen Ributzka juergen at apple.com
Thu Dec 19 17:43:25 PST 2013


>   // Ask the target to do the actual folding.
> -  MachineInstr *NewMI = foldMemoryOperandImpl(MF, MI, Ops, LoadMI);
> +  MachineInstr *NewMI = 0;
> +  int FrameIndex = 0;
> +
> +  if ((MI->getOpcode() == TargetOpcode::STACKMAP ||
> +       MI->getOpcode() == TargetOpcode::PATCHPOINT) &&
> +      isLoadFromStackSlot(LoadMI, FrameIndex)) {
> +    // Fold stackmap/patchpoint.
> +    NewMI = foldPatchpoint(MF, MI, Ops, FrameIndex, *this);
> +  } else {
> +    // Ask the target to do the actual folding.
> +    NewMI =foldMemoryOperandImpl(MF, MI, Ops, LoadMI);
> +  }
> +  foldMemoryOperandImpl(MF, MI, Ops, LoadMI);

Looks like we are folding here twice and never use the result?

-Juergen



More information about the llvm-commits mailing list