[PATCH] D19861: Pass LiveIntervals to foldMemoryOperandImpl(), to enable checking of liveness of preg (flag reg).

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 10:47:17 PDT 2016


MatzeB accepted this revision.
MatzeB added a comment.
This revision is now accepted and ready to land.

In http://reviews.llvm.org/D19861#424384, @jonpa wrote:

> Other targets methods modified as well.
>
> I realized that LIS may not actually be available (e.g. when called from X86::optimizeLoadInstr()), so I changed the LIS argument into a pointer type with default value of nullptr.


LGTM

> Not sure if there is a better way to assert for single reg unit in SystemZInstrInfo::foldMemoryOperandImpl()?


I don't know of any better either.

> Not sure if there is / should be a simpler way of checking liveness of a register at the point of an instruction. For example LIS->isRegisterLiveAtInstruction(SystemZ::CC, MI) and LIS->createDeadDefAt(System::CC, MI)?


isRegisterLiveAtInstruction() would be too simplistic. Look at the existing LiveRange::Query() which gathers all liveness related information you may need about an instruction. We could add a convenience function around that (in another patch) though I  I personally didn't miss it much and often needed the SlotIndex, LiveInterval anyway so the convenience method wouldn't have helped.


http://reviews.llvm.org/D19861





More information about the llvm-commits mailing list