summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-10-30 20:39:19 +0000
committerChad Rosier <mcrosier@apple.com>2012-10-30 20:39:19 +0000
commitdaeec8fad3a3038247df1e5081b74454e7ee9315 (patch)
treecd62d5426ed84f5cfe66990901e7404be6b8c77e /include/llvm/CodeGen
parenta9779bfbc9ab0cf3f157453fd0afd110b04a9fdc (diff)
downloadllvm-daeec8fad3a3038247df1e5081b74454e7ee9315.tar.gz
llvm-daeec8fad3a3038247df1e5081b74454e7ee9315.tar.bz2
llvm-daeec8fad3a3038247df1e5081b74454e7ee9315.tar.xz
[inline asm] Get the mayLoad/mayStore directly from the MIOp_ExtraInfo operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r--include/llvm/CodeGen/MachineInstr.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index 42709012d2..7eb03a9301 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -58,10 +58,8 @@ public:
NoFlags = 0,
FrameSetup = 1 << 0, // Instruction is used as a part of
// function frame setup code.
- InsideBundle = 1 << 1, // Instruction is inside a bundle (not
+ InsideBundle = 1 << 1 // Instruction is inside a bundle (not
// the first MI in a bundle)
- MayLoad = 1 << 2, // Instruction could possibly read memory.
- MayStore = 1 << 3 // Instruction could possibly modify memory.
};
private:
const MCInstrDesc *MCID; // Instruction descriptor.
@@ -447,7 +445,12 @@ public:
/// Instructions with this flag set are not necessarily simple load
/// instructions, they may load a value and modify it, for example.
bool mayLoad(QueryType Type = AnyInBundle) const {
- return hasProperty(MCID::MayLoad, Type) || (Flags & MayLoad);
+ if (isInlineAsm()) {
+ unsigned ExtraInfo = getOperand(InlineAsm::MIOp_ExtraInfo).getImm();
+ if (ExtraInfo & InlineAsm::Extra_MayLoad)
+ return true;
+ }
+ return hasProperty(MCID::MayLoad, Type);
}
@@ -456,7 +459,12 @@ public:
/// instructions, they may store a modified value based on their operands, or
/// may not actually modify anything, for example.
bool mayStore(QueryType Type = AnyInBundle) const {
- return hasProperty(MCID::MayStore, Type) || (Flags & MayStore);
+ if (isInlineAsm()) {
+ unsigned ExtraInfo = getOperand(InlineAsm::MIOp_ExtraInfo).getImm();
+ if (ExtraInfo & InlineAsm::Extra_MayStore)
+ return true;
+ }
+ return hasProperty(MCID::MayStore, Type);
}
//===--------------------------------------------------------------------===//