Add hasLoadFromStackSlot and hasStoreToStackSlot to return whether a
authorDavid Greene <greened@obbligato.org>
Thu, 12 Nov 2009 20:55:29 +0000 (20:55 +0000)
committerDavid Greene <greened@obbligato.org>
Thu, 12 Nov 2009 20:55:29 +0000 (20:55 +0000)
commitb87bc95db075dae3033a3c541b55b4cb711c332c
treef1111bb6bee282dc38926ae7457ec5dbb2364185
parentdb99095cfe2690509a27820aa384bc528426e471
Add hasLoadFromStackSlot and hasStoreToStackSlot to return whether a
machine instruction loads or stores from/to a stack slot.  Unlike
isLoadFromStackSlot and isStoreFromStackSlot, the instruction may be
something other than a pure load/store (e.g. it may be an arithmetic
operation with a memory operand).  This helps AsmPrinter determine when
to print a spill/reload comment.

This is only a hint since we may not be able to figure this out in all
cases.  As such, it should not be relied upon for correctness.

Implement for X86.  Return false by default for other architectures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87026 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetInstrInfo.h
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrInfo.h