File tree Expand file tree Collapse file tree 2 files changed +40
-1
lines changed
test/Transforms/SimplifyCFG Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -778,8 +778,10 @@ struct ConstantComparesGatherer {
778778 return false ;
779779
780780 // Add all values from the range to the set
781- for (APInt Tmp = Span.getLower (); Tmp != Span.getUpper (); ++Tmp)
781+ APInt Tmp = Span.getLower ();
782+ do
782783 Vals.push_back (ConstantInt::get (I->getContext (), Tmp));
784+ while (++Tmp != Span.getUpper ());
783785
784786 UsedICmps++;
785787 return true ;
Original file line number Diff line number Diff line change 1+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
2+ ; RUN: opt -S -passes=simplifycfg < %s | FileCheck %s
3+
4+ ; Make sure we handle full-set ranges correctly.
5+ define void @test_i1 () {
6+ ; CHECK-LABEL: define void @test_i1() {
7+ ; CHECK-NEXT: [[BB:.*:]]
8+ ; CHECK-NEXT: ret void
9+ ;
10+ bb:
11+ %icmp = icmp ugt i1 false , true
12+ br label %bb5
13+
14+ bb5:
15+ %select = select i1 %icmp , i1 %icmp , i1 false
16+ br i1 %select , label %bb5 , label %bb6
17+
18+ bb6:
19+ ret void
20+ }
21+
22+ define void @test_i3 () {
23+ ; CHECK-LABEL: define void @test_i3() {
24+ ; CHECK-NEXT: [[BB:.*:]]
25+ ; CHECK-NEXT: ret void
26+ ;
27+ bb:
28+ %icmp = icmp ugt i3 0 , 7
29+ br label %bb5
30+
31+ bb5:
32+ %select = select i1 %icmp , i1 %icmp , i1 false
33+ br i1 %select , label %bb5 , label %bb6
34+
35+ bb6:
36+ ret void
37+ }
You can’t perform that action at this time.
0 commit comments