diff options
author | Dale Johannesen <dalej@apple.com> | 2009-04-18 00:09:40 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2009-04-18 00:09:40 +0000 |
commit | 97d14fcb6aa54b66e8513fccea0d0470afa4056a (patch) | |
tree | b899d11b5e08f421ce7887f5270960cd024b7e6e /lib/CodeGen | |
parent | 46445389d36d3b8f92b13810e385bcc75642dba1 (diff) | |
download | external_llvm-97d14fcb6aa54b66e8513fccea0d0470afa4056a.zip external_llvm-97d14fcb6aa54b66e8513fccea0d0470afa4056a.tar.gz external_llvm-97d14fcb6aa54b66e8513fccea0d0470afa4056a.tar.bz2 |
Inline asm's were still introducing bogus dependencies;
my earlier patch to this code only fixed half of it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index 5204113..b20f061 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/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. |