[Beignet] [PATCH 1/2] GBE: remove useless code.

Zhigang Gong zhigang.gong at intel.com
Tue Dec 2 01:42:28 PST 2014


Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
---
 backend/src/llvm/llvm_passes.cpp | 27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/backend/src/llvm/llvm_passes.cpp b/backend/src/llvm/llvm_passes.cpp
index ff9ab76..cb68fe6 100644
--- a/backend/src/llvm/llvm_passes.cpp
+++ b/backend/src/llvm/llvm_passes.cpp
@@ -225,19 +225,10 @@ namespace gbe
 
    public:
     static char ID;
-#define FORMER_VERSION 0
-#if FORMER_VERSION
-   GenRemoveGEPPasss(map<const Value *, const Value *>& 
-                                       parentCompositePointer)
-     : BasicBlockPass(ID),
-     parentPointers(parentCompositePointer) {}
-    map<const Value *, const Value *>& parentPointers;
-#else
-   GenRemoveGEPPasss(const ir::Unit &unit) :
-     BasicBlockPass(ID),
-     unit(unit) {}
-  const ir::Unit &unit;
-#endif
+    GenRemoveGEPPasss(const ir::Unit &unit) :
+      BasicBlockPass(ID),
+      unit(unit) {}
+    const ir::Unit &unit;
     void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesCFG();
     }
@@ -267,9 +258,6 @@ namespace gbe
   {
     const uint32_t ptrSize = unit.getPointerSize();
     Value* parentPointer = GEPInst->getOperand(0);
-#if FORMER_VERSION
-    Value* topParent = parentPointer;
-#endif
     CompositeType* CompTy = cast<CompositeType>(parentPointer->getType());
 
     Value* currentAddrInst = 
@@ -385,13 +373,6 @@ namespace gbe
     GEPInst->dropAllReferences();
     GEPInst->eraseFromParent();
 
-#if FORMER_VERSION
-    //insert new pointer into parent list
-    while(parentPointers.find(topParent)!=parentPointers.end())
-      topParent = parentPointers.find(topParent)->second;
-    parentPointers[intToPtrInst] = topParent;
-#endif
-
     return true;
   }
 
-- 
1.8.3.2



More information about the Beignet mailing list