@@ -756,3 +756,129 @@ e.1:
756
756
e.2 :
757
757
ret void
758
758
}
759
+
760
+ define void @all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref_via_assumption_nofree_via_context (ptr %A , ptr %B ) nosync {
761
+ ; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref_via_assumption_nofree_via_context'
762
+ ; CHECK-NEXT: loop.header:
763
+ ; CHECK-NEXT: Memory dependences are safe with run-time checks
764
+ ; CHECK-NEXT: Dependences:
765
+ ; CHECK-NEXT: Run-time memory checks:
766
+ ; CHECK-NEXT: Check 0:
767
+ ; CHECK-NEXT: Comparing group GRP0:
768
+ ; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv
769
+ ; CHECK-NEXT: Against group GRP1:
770
+ ; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv
771
+ ; CHECK-NEXT: Grouped accesses:
772
+ ; CHECK-NEXT: Group GRP0:
773
+ ; CHECK-NEXT: (Low: %B High: inttoptr (i64 -1 to ptr))
774
+ ; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>
775
+ ; CHECK-NEXT: Group GRP1:
776
+ ; CHECK-NEXT: (Low: %A High: inttoptr (i64 -1 to ptr))
777
+ ; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>
778
+ ; CHECK-EMPTY:
779
+ ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
780
+ ; CHECK-NEXT: SCEV assumptions:
781
+ ; CHECK-EMPTY:
782
+ ; CHECK-NEXT: Expressions re-written:
783
+ ;
784
+ entry:
785
+ call void @llvm.assume (i1 true ) [ "dereferenceable" (ptr %A , i64 2000 ) ]
786
+ call void @llvm.assume (i1 true ) [ "dereferenceable" (ptr %B , i64 2000 ) ]
787
+ br label %loop.header
788
+
789
+ loop.header:
790
+ %iv = phi i64 [ 0 , %entry ], [ %iv.next , %latch ]
791
+ %gep.A = getelementptr inbounds i32 , ptr %A , i64 %iv
792
+ %gep.B = getelementptr inbounds i32 , ptr %B , i64 %iv
793
+ %l = load i32 , ptr %gep.A , align 4
794
+ store i32 0 , ptr %gep.B , align 4
795
+ %cntable.c.1 = icmp ult i64 %iv , 1000
796
+ %iv.next = add nuw nsw i64 %iv , 1
797
+ br i1 %cntable.c.1 , label %b2 , label %e.1
798
+
799
+ b2:
800
+ %uncntable.c.0 = icmp eq i32 %l , 0
801
+ br i1 %uncntable.c.0 , label %e.2 , label %b3
802
+
803
+ b3:
804
+ %cntable.c.2 = icmp eq i64 %iv.next , 500
805
+ br i1 %cntable.c.2 , label %cleanup4 , label %latch
806
+
807
+ latch:
808
+ br label %loop.header
809
+
810
+ cleanup4:
811
+ ret void
812
+
813
+ e.1 :
814
+ ret void
815
+
816
+ e.2 :
817
+ ret void
818
+ }
819
+
820
+ define void @all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref_via_assumption_missing_nofree_multiple_predecessors (ptr %A , ptr %B , i1 %c ) nosync {
821
+ ; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref_via_assumption_missing_nofree_multiple_predecessors'
822
+ ; CHECK-NEXT: loop.header:
823
+ ; CHECK-NEXT: Memory dependences are safe with run-time checks
824
+ ; CHECK-NEXT: Dependences:
825
+ ; CHECK-NEXT: Run-time memory checks:
826
+ ; CHECK-NEXT: Check 0:
827
+ ; CHECK-NEXT: Comparing group GRP0:
828
+ ; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv
829
+ ; CHECK-NEXT: Against group GRP1:
830
+ ; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv
831
+ ; CHECK-NEXT: Grouped accesses:
832
+ ; CHECK-NEXT: Group GRP0:
833
+ ; CHECK-NEXT: (Low: %B High: inttoptr (i64 -1 to ptr))
834
+ ; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>
835
+ ; CHECK-NEXT: Group GRP1:
836
+ ; CHECK-NEXT: (Low: %A High: inttoptr (i64 -1 to ptr))
837
+ ; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>
838
+ ; CHECK-EMPTY:
839
+ ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
840
+ ; CHECK-NEXT: SCEV assumptions:
841
+ ; CHECK-EMPTY:
842
+ ; CHECK-NEXT: Expressions re-written:
843
+ ;
844
+ entry:
845
+ call void @llvm.assume (i1 true ) [ "dereferenceable" (ptr %A , i64 2000 ) ]
846
+ call void @llvm.assume (i1 true ) [ "dereferenceable" (ptr %B , i64 2000 ) ]
847
+ br i1 %c , label %then , label %else
848
+
849
+ then:
850
+ br label %loop.header
851
+
852
+ else:
853
+ br label %loop.header
854
+
855
+ loop.header:
856
+ %iv = phi i64 [ 0 , %then ], [ 0 , %else ], [ %iv.next , %latch ]
857
+ %gep.A = getelementptr inbounds i32 , ptr %A , i64 %iv
858
+ %gep.B = getelementptr inbounds i32 , ptr %B , i64 %iv
859
+ %l = load i32 , ptr %gep.A , align 4
860
+ store i32 0 , ptr %gep.B , align 4
861
+ %cntable.c.1 = icmp ult i64 %iv , 1000
862
+ %iv.next = add nuw nsw i64 %iv , 1
863
+ br i1 %cntable.c.1 , label %b2 , label %e.1
864
+
865
+ b2:
866
+ %uncntable.c.0 = icmp eq i32 %l , 0
867
+ br i1 %uncntable.c.0 , label %e.2 , label %b3
868
+
869
+ b3:
870
+ %cntable.c.2 = icmp eq i64 %iv.next , 500
871
+ br i1 %cntable.c.2 , label %cleanup4 , label %latch
872
+
873
+ latch:
874
+ br label %loop.header
875
+
876
+ cleanup4:
877
+ ret void
878
+
879
+ e.1 :
880
+ ret void
881
+
882
+ e.2 :
883
+ ret void
884
+ }
0 commit comments