OSDN Git Service

Fix eliminating stores to pointer arguments.
authorNicolas Capens <capn@google.com>
Fri, 27 Jan 2017 10:26:12 +0000 (02:26 -0800)
committerNicolas Capens <capn@google.com>
Mon, 30 Jan 2017 16:44:23 +0000 (16:44 +0000)
If a store address has no definition, it must be a pointer argument.
Unlike stores to alloca's, these are not dead.

Change-Id: I66e50b14ffea1cfc61fc756b5545ab8ae28b4bf8
Reviewed-on: https://swiftshader-review.googlesource.com/8573
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
src/Reactor/Optimizer.cpp

index 75b225e..fa12a92 100644 (file)
@@ -454,7 +454,7 @@ namespace
                        {
                                Ice::Inst *def = definition[address];
 
-                               if(!def || llvm::isa<Ice::InstAlloca>(def))
+                               if(def && llvm::isa<Ice::InstAlloca>(def))
                                {
                                        return uses[address].size() == 1;   // Dead if this store is the only use
                                }