Skip to content

Commit a472517

Browse files
committed
Revert "Check shamt before extracting bits from an ashr (AliveToolkit#1150)"
This reverts commit 9b2d131.
1 parent 2385111 commit a472517

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

smt/expr.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1890,8 +1890,10 @@ expr expr::extract(unsigned high, unsigned low, unsigned depth) const {
18901890
expr a, b;
18911891
if (isAShr(a, b)) {
18921892
uint64_t shift;
1893-
if (b.isUInt(shift) && shift < a.bits() && high + shift < a.bits())
1893+
if (b.isUInt(shift) && high + shift < a.bits()) {
1894+
assert(shift < a.bits());
18941895
return a.extract(high + shift, low + shift);
1896+
}
18951897
}
18961898
}
18971899
{

tests/alive-tv/samesign.srctgt.ll

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,3 @@ define i1 @tgt(i8 %x, i8 %y) {
77
%cmp = icmp samesign ult i8 %x, %y
88
ret i1 %cmp
99
}
10-
11-
define i1 @src1(i64 %x) {
12-
%ashr = ashr i64 %x, -1
13-
%cmp = icmp samesign ugt i64 %ashr, 0
14-
ret i1 %cmp
15-
}
16-
17-
define i1 @tgt1(i64 %x) {
18-
ret i1 poison
19-
}

0 commit comments

Comments
 (0)