[PATCH] CFLAA -- ConstantExpr Awareness
    David Majnemer 
    david.majnemer at gmail.com
       
    Fri Mar  6 00:28:29 PST 2015
    
    
  
================
Comment at: lib/Analysis/CFLAliasAnalysis.cpp:961-971
@@ +960,13 @@
+
+static bool canSkipAddingToSets(Value *Val) {
+  // Constants can share instances, which may falsely unify multiple
+  // sets, e.g. in
+  // store i32* null, i32** %ptr1
+  // store i32* null, i32** %ptr2
+  // clearly ptr1 and ptr2 should not be unified into the same set, so
+  // we should filter out the (potentially shared) instance to
+  // i32* null.
+  return isa<Constant>(Val) && !isa<GlobalValue>(Val) &&
+         !isa<ConstantExpr>(Val);
+}
+
----------------
What if the constant is a ConstantArray/ConstantStruct/ConstantVector with a GlobalValue field?
http://reviews.llvm.org/D8099
EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
    
    
More information about the llvm-commits
mailing list