diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-10-30 19:11:54 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-10-30 19:11:54 +0000 |
commit | 3d71688476951d56ac00a81b17c2f83fd781b208 (patch) | |
tree | 13c4910a677393f45e540d495ba0a5fee1a3f0eb /include/llvm | |
parent | e7b406d7ac150189522f0a139f1a2f76bde2cb26 (diff) | |
download | external_llvm-3d71688476951d56ac00a81b17c2f83fd781b208.zip external_llvm-3d71688476951d56ac00a81b17c2f83fd781b208.tar.gz external_llvm-3d71688476951d56ac00a81b17c2f83fd781b208.tar.bz2 |
[inline asm] Implement mayLoad and mayStore for inline assembly. In general,
the MachineInstr MayLoad/MayLoad flags are based on the tablegen implementation.
For inline assembly, however, we need to compute these based on the constraints.
Revert r166929 as this is no longer needed, but leave the test case in place.
rdar://12033048 and PR13504
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 8 | ||||
-rw-r--r-- | include/llvm/InlineAsm.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index eab74bd..4270901 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -58,8 +58,10 @@ 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. @@ -445,7 +447,7 @@ 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); + return hasProperty(MCID::MayLoad, Type) || (Flags & MayLoad); } @@ -454,7 +456,7 @@ 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); + return hasProperty(MCID::MayStore, Type) || (Flags & MayStore); } //===--------------------------------------------------------------------===// diff --git a/include/llvm/InlineAsm.h b/include/llvm/InlineAsm.h index c6e0aab..b5e0fd4 100644 --- a/include/llvm/InlineAsm.h +++ b/include/llvm/InlineAsm.h @@ -214,6 +214,8 @@ public: Extra_HasSideEffects = 1, Extra_IsAlignStack = 2, Extra_AsmDialect = 4, + Extra_MayLoad = 8, + Extra_MayStore = 16, // Inline asm operands map to multiple SDNode / MachineInstr operands. // The first operand is an immediate describing the asm operand, the low |