mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
Update equalsStoreHelper for the fact that only one branch can be true
llvm-svn: 290697
This commit is contained in:
parent
85f5dbd306
commit
231815c580
@ -189,7 +189,7 @@ class NewGVN : public FunctionPass {
|
|||||||
// We could use the congruence class machinery, but the MemoryAccess's are
|
// We could use the congruence class machinery, but the MemoryAccess's are
|
||||||
// abstract memory states, so they can only ever be equivalent to each other,
|
// abstract memory states, so they can only ever be equivalent to each other,
|
||||||
// and not to constants, etc.
|
// and not to constants, etc.
|
||||||
DenseMap<MemoryAccess *, MemoryAccess *> MemoryAccessEquiv;
|
DenseMap<const MemoryAccess *, MemoryAccess *> MemoryAccessEquiv;
|
||||||
|
|
||||||
// Expression to class mapping.
|
// Expression to class mapping.
|
||||||
using ExpressionClassMap = DenseMap<const Expression *, CongruenceClass *>;
|
using ExpressionClassMap = DenseMap<const Expression *, CongruenceClass *>;
|
||||||
@ -351,14 +351,15 @@ FunctionPass *llvm::createNewGVNPass() { return new NewGVN(); }
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
static bool equalsLoadStoreHelper(const T &LHS, const Expression &RHS) {
|
static bool equalsLoadStoreHelper(const T &LHS, const Expression &RHS) {
|
||||||
if ((!isa<LoadExpression>(RHS) && !isa<StoreExpression>(RHS)) ||
|
if ((!isa<LoadExpression>(RHS) && !isa<StoreExpression>(RHS)) ||
|
||||||
!LHS.BasicExpression::equals(RHS))
|
!LHS.BasicExpression::equals(RHS)) {
|
||||||
return false;
|
return false;
|
||||||
if (const auto *L = dyn_cast<LoadExpression>(&RHS))
|
} else if (const auto *L = dyn_cast<LoadExpression>(&RHS)) {
|
||||||
if (LHS.getDefiningAccess() != L->getDefiningAccess())
|
if (LHS.getDefiningAccess() != L->getDefiningAccess())
|
||||||
return false;
|
return false;
|
||||||
if (const auto *S = dyn_cast<StoreExpression>(&RHS))
|
} else if (const auto *S = dyn_cast<StoreExpression>(&RHS)) {
|
||||||
if (LHS.getDefiningAccess() != S->getDefiningAccess())
|
if (LHS.getDefiningAccess() != S->getDefiningAccess())
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user