summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
diff options
context:
space:
mode:
authorPreston Gurd <preston.gurd@intel.com>2012-10-29 15:01:23 +0000
committerPreston Gurd <preston.gurd@intel.com>2012-10-29 15:01:23 +0000
commit52dacca9773bd0a7df02b005dc56cf4caca02323 (patch)
tree22da77bd5aa95c156d3a9b6263d57e9340add125 /llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
parentbbc661e572fdcd4fd8b3829308e0328ad69cedd4 (diff)
downloadbcm5719-llvm-52dacca9773bd0a7df02b005dc56cf4caca02323.tar.gz
bcm5719-llvm-52dacca9773bd0a7df02b005dc56cf4caca02323.zip
This patch addresses a problem with the Post RA scheduler generating an
incorrect instruction sequence due to it not being aware that an inline assembly instruction may reference memory. This patch fixes the problem by causing the scheduler to always assume that any inline assembly code instruction could access memory. This is necessary because the internal representation of the inline instruction does not include any information about memory accesses. This should fix PR13504. llvm-svn: 166929
Diffstat (limited to 'llvm/lib/CodeGen/ScheduleDAGInstrs.cpp')
-rw-r--r--llvm/lib/CodeGen/ScheduleDAGInstrs.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
index 496473d3a4b..8ea0f8a3eac 100644
--- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -420,6 +420,11 @@ void ScheduleDAGInstrs::addVRegUseDeps(SUnit *SU, unsigned OperIdx) {
/// Return true if MI is an instruction we are unable to reason about
/// (like a call or something with unmodeled side effects).
static inline bool isGlobalMemoryObject(AliasAnalysis *AA, MachineInstr *MI) {
+ if (MI->isInlineAsm()) {
+ // Until we can tell if an inline assembly instruction accesses
+ // memory, we must assume all such instructions do so.
+ return true;
+ }
if (MI->isCall() || MI->hasUnmodeledSideEffects() ||
(MI->hasOrderedMemoryRef() &&
(!MI->mayLoad() || !MI->isInvariantLoad(AA))))
OpenPOWER on IntegriCloud