[llvm-branch-commits] [llvm-branch] r69614 - /llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

Bill Wendling isanbard at gmail.com
Mon Apr 20 11:18:11 PDT 2009


Author: void
Date: Mon Apr 20 13:18:11 2009
New Revision: 69614

URL: http://llvm.org/viewvc/llvm-project?rev=69614&view=rev
Log:
--- Merging (from foreign repository) r69408 into '.':
U    lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

Inline asm's were still introducing bogus dependencies;
my earlier patch to this code only fixed half of it.

Modified:
    llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=69614&r1=69613&r2=69614&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Apr 20 13:18:11 2009
@@ -5122,7 +5122,9 @@
   /// 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;
@@ -5133,6 +5135,10 @@
     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.





More information about the llvm-branch-commits mailing list