Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/Analysis/HashRecognize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ std::variant<PolynomialInfo, StringRef> HashRecognize::recognizeCRC() const {
if (!Latch || !Exit || !IndVar || L.getNumBlocks() != 1)
return "Loop not in canonical form";
unsigned TC = SE.getSmallConstantTripCount(&L);
if (!TC || TC > 256 || TC % 8)
if (!TC || TC % 8)
return "Unable to find a small constant byte-multiple trip count";

auto R = getRecurrences(Latch, IndVar, L);
Expand Down
8 changes: 4 additions & 4 deletions llvm/test/Analysis/HashRecognize/cyclic-redundancy-check.ll
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,10 @@ exit: ; preds = %loop
ret i16 %crc.next
}

define i16 @not.crc.tc.limit(i16 %crc.init) {
; CHECK-LABEL: 'not.crc.tc.limit'
define i16 @not.crc.tc.exceeds.data.bw(i16 %crc.init) {
; CHECK-LABEL: 'not.crc.tc.exceeds.data.bw'
; CHECK-NEXT: Did not find a hash algorithm
; CHECK-NEXT: Reason: Unable to find a small constant byte-multiple trip count
; CHECK-NEXT: Reason: Loop iterations exceed bitwidth of data
;
entry:
br label %loop
Expand All @@ -590,7 +590,7 @@ loop: ; preds = %loop, %entry
%check.sb = icmp slt i16 %crc, 0
%crc.next = select i1 %check.sb, i16 %crc.xor, i16 %crc.shl
%iv.next = add nuw nsw i32 %iv, 1
%exit.cond = icmp samesign ult i32 %iv, 512
%exit.cond = icmp samesign ult i32 %iv, 511
br i1 %exit.cond, label %loop, label %exit

exit: ; preds = %loop
Expand Down
Loading