mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 22:30:33 +00:00
[EarlyCSE] Don't add the overflow flags to the hash
We take the intersection of overflow flags while CSE'ing. This permits us to consider two instructions with different overflow behavior to be replaceable. llvm-svn: 267153
This commit is contained in:
parent
2e439346e9
commit
0c47b59618
@ -97,15 +97,6 @@ unsigned DenseMapInfo<SimpleValue>::getHashValue(SimpleValue Val) {
|
||||
if (BinOp->isCommutative() && BinOp->getOperand(0) > BinOp->getOperand(1))
|
||||
std::swap(LHS, RHS);
|
||||
|
||||
if (isa<OverflowingBinaryOperator>(BinOp)) {
|
||||
// Hash the overflow behavior
|
||||
unsigned Overflow =
|
||||
BinOp->hasNoSignedWrap() * OverflowingBinaryOperator::NoSignedWrap |
|
||||
BinOp->hasNoUnsignedWrap() *
|
||||
OverflowingBinaryOperator::NoUnsignedWrap;
|
||||
return hash_combine(BinOp->getOpcode(), Overflow, LHS, RHS);
|
||||
}
|
||||
|
||||
return hash_combine(BinOp->getOpcode(), LHS, RHS);
|
||||
}
|
||||
|
||||
|
@ -26,10 +26,9 @@ define void @test1(i8 %V, i32 *%P) {
|
||||
; CHECK-NEXT: store volatile i32 %E
|
||||
; CHECK-NEXT: store volatile i32 %E
|
||||
|
||||
%G = add nuw i32 %C, %C ;; not a CSE with E
|
||||
%G = add nuw i32 %C, %C
|
||||
store volatile i32 %G, i32* %P
|
||||
; CHECK-NEXT: %G = add nuw i32 %C, %C
|
||||
; CHECK-NEXT: store volatile i32 %G
|
||||
; CHECK-NEXT: store volatile i32 %E
|
||||
ret void
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user