summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-04-18 00:09:40 +0000
committerDale Johannesen <dalej@apple.com>2009-04-18 00:09:40 +0000
commitad968ee286a4c8bd6797099816ce31082097ad52 (patch)
tree40c8a3c74b305f2971d959748eb6cd895e783275 /llvm/lib
parent3c3aa617581999a0ad757c05fd8920682bedaccc (diff)
downloadbcm5719-llvm-ad968ee286a4c8bd6797099816ce31082097ad52.tar.gz
bcm5719-llvm-ad968ee286a4c8bd6797099816ce31082097ad52.zip
Inline asm's were still introducing bogus dependencies;
my earlier patch to this code only fixed half of it. llvm-svn: 69408
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index 5204113b3aa..b20f061e03c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -5111,7 +5111,9 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) {
/// ConstraintOperands - Information about all of the constraints.
std::vector<SDISelAsmOperandInfo> ConstraintOperands;
- SDValue Chain = getRoot();
+ // We won't need to flush pending loads if this asm doesn't touch
+ // memory and is nonvolatile.
+ SDValue Chain = IA->hasSideEffects() ? getRoot() : DAG.getRoot();
SDValue Flag;
std::set<unsigned> OutputRegs, InputRegs;
@@ -5122,6 +5124,10 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) {
ConstraintInfos = IA->ParseConstraints();
bool hasMemory = hasInlineAsmMemConstraint(ConstraintInfos, TLI);
+ // Flush pending loads if this touches memory (includes clobbering it).
+ // It's possible this is overly conservative.
+ if (hasMemory)
+ Chain = getRoot();
unsigned ArgNo = 0; // ArgNo - The argument of the CallInst.
unsigned ResNo = 0; // ResNo - The result number of the next output.
OpenPOWER on IntegriCloud