llvm.org GIT mirror llvm / 91f0821
Merging r322016: ------------------------------------------------------------------------ r322016 | spatel | 2018-01-08 19:31:13 +0100 (Mon, 08 Jan 2018) | 8 lines [ValueTracking] remove overzealous assert The test is derived from a failing fuzz test: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5008 Credit to @rksimon for pointing out the problem. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@323740 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 1 year, 7 months ago
2 changed file(s) with 22 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
42144214 break;
42154215 return {SPF_UNKNOWN, SPNB_NA, false};
42164216 default:
4217 llvm_unreachable("Bad flavor while matching min/max");
4217 return {SPF_UNKNOWN, SPNB_NA, false};
42184218 }
42194219
42204220 // a pred c ? m(a, b) : m(c, b) --> m(m(a, b), m(c, b))
898898 ret i32 %max_abc
899899 }
900900
901 ; This would assert. Don't assume that earlier min/max types match a possible later min/max.
902
903 define float @not_min_of_min(i8 %i, float %x) {
904 ; CHECK-LABEL: @not_min_of_min(
905 ; CHECK-NEXT: [[CMP1_INV:%.*]] = fcmp fast oge float [[X:%.*]], 1.000000e+00
906 ; CHECK-NEXT: [[MIN1:%.*]] = select i1 [[CMP1_INV]], float 1.000000e+00, float [[X]]
907 ; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp fast oge float [[X]], 2.000000e+00
908 ; CHECK-NEXT: [[MIN2:%.*]] = select i1 [[CMP2_INV]], float 2.000000e+00, float [[X]]
909 ; CHECK-NEXT: [[CMP3:%.*]] = icmp ult i8 [[I:%.*]], 16
910 ; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP3]], float [[MIN1]], float [[MIN2]]
911 ; CHECK-NEXT: ret float [[R]]
912 ;
913 %cmp1 = fcmp fast ult float %x, 1.0
914 %min1 = select i1 %cmp1, float %x, float 1.0
915 %cmp2 = fcmp fast ult float %x, 2.0
916 %min2 = select i1 %cmp2, float %x, float 2.0
917 %cmp3 = icmp ult i8 %i, 16
918 %r = select i1 %cmp3, float %min1, float %min2
919 ret float %r
920 }
921