[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Mar 5 11:04:44 PST 2005



Changes in directory llvm/lib/Analysis/DataStructure:

Local.cpp updated: 1.124 -> 1.125
---
Log message:

Make sure the two arguments of a setcc instruction point to the same node.


---
Diffs of the changes:  (+8 -1)

 Local.cpp |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)


Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.124 llvm/lib/Analysis/DataStructure/Local.cpp:1.125
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.124	Fri Mar  4 14:27:46 2005
+++ llvm/lib/Analysis/DataStructure/Local.cpp	Sat Mar  5 13:04:31 2005
@@ -112,7 +112,7 @@
     void visitStoreInst(StoreInst &SI);
     void visitCallInst(CallInst &CI);
     void visitInvokeInst(InvokeInst &II);
-    void visitSetCondInst(SetCondInst &SCI) {}  // SetEQ & friends are ignored
+    void visitSetCondInst(SetCondInst &SCI);
     void visitFreeInst(FreeInst &FI);
     void visitCastInst(CastInst &CI);
     void visitInstruction(Instruction &I);
@@ -325,6 +325,13 @@
   Dest.mergeWith(getValueDest(*SI.getOperand(2)));
 }
 
+void GraphBuilder::visitSetCondInst(SetCondInst &SCI) {
+  if (!isPointerType(SCI.getOperand(0)->getType()) ||
+      isa<ConstantPointerNull>(SCI.getOperand(1))) return; // Only pointers
+  ScalarMap[SCI.getOperand(0)].mergeWith(getValueDest(*SCI.getOperand(1)));
+}
+
+
 void GraphBuilder::visitGetElementPtrInst(User &GEP) {
   DSNodeHandle Value = getValueDest(*GEP.getOperand(0));
   if (Value.isNull())






More information about the llvm-commits mailing list