Stores are dead if the address is from an alloca and all uses of the
address are stores, not just when it's a single store.
Change-Id: I5b65a64e21b9e398922e5440c35f0d318c03e911
Reviewed-on: https://swiftshader-review.googlesource.com/8574
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
if(def && llvm::isa<Ice::InstAlloca>(def))
{
- return uses[address].size() == 1; // Dead if this store is the only use
+ return uses[address].size() == uses[address].stores.size(); // Dead if all uses are stores
}
}
}