[PATCH] D15632: [GC][In Progress] Relocating vectors of pointers

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 00:06:07 PST 2015


sanjoy added a comment.

As I've said in person, I'm worried about LLVM (SelectionDAG & later,
specifically) making assumptions on how spill slots can be used.  For
instance, if there is an assumption that spill slots are strictly
frame local, then this transform becomes legal (gc_ref is a callee
saved register):

  [%rsp + 48] = gc_ref
  call _foo ## statepoint
  gc_ref_relocated = [%rsp + 48]



>
=

  [%rsp + 48] = gc_ref
  gc_ref_relocated = [%rsp + 48]
  call _foo ## statepoint

Since the call to _foo could not have possibly clobbered a frame local
location (since the frame is where you spill registers to *avoid* them
getting clobbered!).

In fact, I suspect this is unsound even today.  I still can't see the
whole picture, but for instance, in MachineLICM.cpp you have:

  static bool InstructionStoresToFI(const MachineInstr *MI, int FI) {
    for (MachineInstr::mmo_iterator o = MI->memoperands_begin(),
           oe = MI->memoperands_end(); o != oe; ++o) {
      if (!(*o)->isStore() || !(*o)->getPseudoValue())
        continue;
      if (const FixedStackPseudoSourceValue *Value =
          dyn_cast<FixedStackPseudoSourceValue>((*o)->getPseudoValue())) {
        if (Value->getFrameIndex() == FI)
          return true;
      }
    }
    return false;
  }

and I don't see how a `STATEPOINT` node (as created in
`StatepointLowering.cpp`) gets a `FixedStackPseudoSourceValue` in its
memoperands vector (the loads and stores we generate around the
`STATEPOINT` node  the right aliasing information).


http://reviews.llvm.org/D15632





More information about the llvm-commits mailing list