[llvm] r277096 - [CFLAA] Check for pointer types in more places.

George Burgess IV via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 18:23:45 PDT 2016


Author: gbiv
Date: Thu Jul 28 20:23:45 2016
New Revision: 277096

URL: http://llvm.org/viewvc/llvm-project?rev=277096&view=rev
Log:
[CFLAA] Check for pointer types in more places.

This patch fixes an assertion that fires when we try to add non-pointer
Values to the CFLGraph. Centralizing the check for whether something
is/isn't a pointer type isn't completely trivial (and, in some cases,
would end up being entirely redundant), but it may be beneficial to do
so if this trips us up more in the future.

Patch by Jia Chen.

Differential Revision: https://reviews.llvm.org/D22947

Modified:
    llvm/trunk/lib/Analysis/CFLGraph.h

Modified: llvm/trunk/lib/Analysis/CFLGraph.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFLGraph.h?rev=277096&r1=277095&r2=277096&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CFLGraph.h (original)
+++ llvm/trunk/lib/Analysis/CFLGraph.h Thu Jul 28 20:23:45 2016
@@ -334,7 +334,8 @@ template <typename CFLAA> class CFLGraph
       // For now, we'll handle this like a landingpad instruction (by placing
       // the
       // result in its own group, and having that group alias externals).
-      addNode(&Inst, getAttrUnknown());
+      if (Inst.getType()->isPointerTy())
+        addNode(&Inst, getAttrUnknown());
     }
 
     static bool isFunctionExternal(Function *Fn) {
@@ -457,7 +458,8 @@ template <typename CFLAA> class CFLGraph
       // Exceptions come from "nowhere", from our analysis' perspective.
       // So we place the instruction its own group, noting that said group may
       // alias externals
-      addNode(&Inst, getAttrUnknown());
+      if (Inst.getType()->isPointerTy())
+        addNode(&Inst, getAttrUnknown());
     }
 
     void visitInsertValueInst(InsertValueInst &Inst) {




More information about the llvm-commits mailing list