-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SILOptimizer] add support for always false comparisons to ArrayBoundsCheckOpts #5622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@aschwaighofer Can you please review? |
@swift-ci Please smoke test |
@swift-ci Please benchmark |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment suggestion and a small code cleanup.
IndVar.Cmp != BuiltinValueKind::ICMP_EQ) | ||
return false; | ||
|
||
// Eencountered a few false condition patterns we can detect and optimize: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also perhaps:
Pattern match a few false condition patterns that we can detect and optimize:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops! thanks. changed that in my current working copy.
@@ -1200,6 +1232,15 @@ static bool hoistBoundsChecks(SILLoop *Loop, DominanceInfo *DT, SILLoopInfo *LI, | |||
Changed = true; | |||
continue; | |||
} | |||
if (isComparisonKnownFalse(Builtin, *IV)) { | |||
if (!FalseVal) { | |||
FalseVal = SILValue(B.createIntegerLiteral( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure you need the SILValue(...) here? I think just assigning the instruction should just work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using same style as Arnold's isComparisonKnownTrue - but I think yes, as you can see you create the instruction just once if you have multiple comparisons / exists
Build comment file:Optimized (O)
|
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
ByteSwap | 0 | 1 | +100000.0% | 0.00x |
Improvement (0)
No Changes (146)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
SetExclusiveOr | 2716 | 2666 | -1.8% | 1.02x(?) |
NSDictionaryCastToSwift | 6997 | 6834 | -2.3% | 1.02x(?) |
ObjectiveCBridgeFromNSArrayAnyObjectToString | 121117 | 120381 | -0.6% | 1.01x(?) |
StrComplexWalk | 2913 | 2890 | -0.8% | 1.01x(?) |
ErrorHandling | 2959 | 2931 | -0.9% | 1.01x(?) |
ArrayOfGenericRef | 3610 | 3591 | -0.5% | 1.01x(?) |
ObjectiveCBridgeToNSDictionary | 16611 | 16467 | -0.9% | 1.01x(?) |
ArraySubscript | 1436 | 1436 | +0.0% | 1.00x |
ObjectiveCBridgeToNSString | 1074 | 1073 | -0.1% | 1.00x(?) |
DictionarySwapOfObjects | 6794 | 6786 | -0.1% | 1.00x(?) |
StackPromo | 21411 | 21396 | -0.1% | 1.00x(?) |
RecursiveOwnedParameter | 1934 | 1933 | -0.1% | 1.00x(?) |
Integrate | 239 | 238 | -0.4% | 1.00x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectToString | 214225 | 214026 | -0.1% | 1.00x(?) |
ClassArrayGetter | 12 | 12 | +0.0% | 1.00x |
Histogram | 657 | 656 | -0.1% | 1.00x(?) |
SortStrings | 1826 | 1825 | -0.1% | 1.00x(?) |
DictionaryBridge | 3849 | 3847 | -0.1% | 1.00x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectForced | 5300 | 5301 | +0.0% | 1.00x(?) |
ObjectiveCBridgeStubFromNSDateRef | 3684 | 3685 | +0.0% | 1.00x(?) |
MonteCarloPi | 44959 | 44969 | +0.0% | 1.00x(?) |
StringWithCString | 156155 | 156788 | +0.4% | 1.00x(?) |
ObjectiveCBridgeFromNSArrayAnyObjectForced | 6265 | 6276 | +0.2% | 1.00x(?) |
ObjectiveCBridgeFromNSStringForced | 2676 | 2674 | -0.1% | 1.00x(?) |
Prims | 735 | 735 | +0.0% | 1.00x |
SortLettersInPlace | 971 | 972 | +0.1% | 1.00x(?) |
DictionarySwap | 633 | 634 | +0.2% | 1.00x(?) |
ObjectiveCBridgeFromNSString | 1812 | 1812 | +0.0% | 1.00x |
ObjectiveCBridgeFromNSDictionaryAnyObject | 194486 | 194213 | -0.1% | 1.00x(?) |
ArrayOfGenericPOD | 220 | 220 | +0.0% | 1.00x |
Dictionary3OfObjects | 857 | 859 | +0.2% | 1.00x(?) |
RangeAssignment | 277 | 278 | +0.4% | 1.00x(?) |
ArrayAppendGenericStructs | 1239 | 1237 | -0.2% | 1.00x(?) |
SuperChars | 211590 | 211740 | +0.1% | 1.00x(?) |
ArrayAppendLazyMap | 847 | 848 | +0.1% | 1.00x(?) |
XorLoop | 380 | 380 | +0.0% | 1.00x |
ArrayAppendReserved | 536 | 536 | +0.0% | 1.00x |
StringInterpolation | 10839 | 10830 | -0.1% | 1.00x(?) |
ObjectiveCBridgeStubToNSString | 1282 | 1279 | -0.2% | 1.00x(?) |
ArrayAppendStrings | 12094 | 12096 | +0.0% | 1.00x(?) |
ObjectiveCBridgeStubFromNSStringRef | 213 | 213 | +0.0% | 1.00x |
ObjectiveCBridgeStubFromNSString | 746 | 747 | +0.1% | 1.00x(?) |
ProtocolDispatch | 3039 | 3039 | +0.0% | 1.00x |
ObjectAllocation | 153 | 153 | +0.0% | 1.00x |
TypeFlood | 0 | 0 | +0.0% | 1.00x |
ObjectiveCBridgeFromNSSetAnyObject | 90408 | 90658 | +0.3% | 1.00x(?) |
ArrayLiteral | 1174 | 1173 | -0.1% | 1.00x(?) |
Walsh | 324 | 324 | +0.0% | 1.00x |
Dictionary3 | 509 | 508 | -0.2% | 1.00x(?) |
Dictionary2 | 2043 | 2044 | +0.1% | 1.00x(?) |
SetIntersect_OfObjects | 2273 | 2273 | +0.0% | 1.00x |
ArrayOfRef | 3526 | 3537 | +0.3% | 1.00x(?) |
ObjectiveCBridgeToNSArray | 30475 | 30586 | +0.4% | 1.00x(?) |
NSError | 327 | 328 | +0.3% | 1.00x(?) |
DictionaryOfObjects | 2283 | 2288 | +0.2% | 1.00x(?) |
ObjectiveCBridgeStubToNSDateRef | 3298 | 3298 | +0.0% | 1.00x |
PopFrontUnsafePointer | 9130 | 9118 | -0.1% | 1.00x(?) |
StringEqualPointerComparison | 7364 | 7364 | +0.0% | 1.00x |
CaptureProp | 4867 | 4869 | +0.0% | 1.00x(?) |
PolymorphicCalls | 21 | 21 | +0.0% | 1.00x |
RC4 | 165 | 165 | +0.0% | 1.00x |
ObjectiveCBridgeStubToNSStringRef | 117 | 117 | +0.0% | 1.00x |
MapReduce | 342 | 343 | +0.3% | 1.00x(?) |
ObjectiveCBridgeStubDateMutation | 273 | 273 | +0.0% | 1.00x |
AngryPhonebook | 2808 | 2799 | -0.3% | 1.00x(?) |
IterateData | 2597 | 2596 | -0.0% | 1.00x(?) |
DictionaryLiteral | 2738 | 2751 | +0.5% | 1.00x(?) |
Hanoi | 3454 | 3456 | +0.1% | 1.00x(?) |
OpenClose | 48 | 48 | +0.0% | 1.00x |
DictionaryRemoveOfObjects | 20000 | 19965 | -0.2% | 1.00x(?) |
UTF8Decode | 288 | 288 | +0.0% | 1.00x |
ObjectiveCBridgeStubURLAppendPath | 236212 | 235358 | -0.4% | 1.00x(?) |
SortStringsUnicode | 8428 | 8425 | -0.0% | 1.00x(?) |
SetIsSubsetOf | 509 | 508 | -0.2% | 1.00x(?) |
Dictionary | 736 | 738 | +0.3% | 1.00x(?) |
NopDeinit | 36671 | 36663 | -0.0% | 1.00x(?) |
ObjectiveCBridgeStubToArrayOfNSString | 29403 | 29320 | -0.3% | 1.00x(?) |
ObjectiveCBridgeFromNSArrayAnyObject | 76006 | 76196 | +0.2% | 1.00x(?) |
SetIntersect | 1085 | 1085 | +0.0% | 1.00x |
ObjectiveCBridgeStubDataAppend | 2991 | 2990 | -0.0% | 1.00x(?) |
ObjectiveCBridgeStubNSDateRefAccess | 338 | 338 | +0.0% | 1.00x |
StrToInt | 5231 | 5232 | +0.0% | 1.00x(?) |
ArrayInClass | 62 | 62 | +0.0% | 1.00x |
StringHasSuffix | 800 | 800 | +0.0% | 1.00x |
Phonebook | 7481 | 7479 | -0.0% | 1.00x(?) |
ObjectiveCBridgeStubDateAccess | 182 | 182 | +0.0% | 1.00x |
Sim2DArray | 277 | 277 | +0.0% | 1.00x |
ArrayAppendRepeatCol | 643 | 644 | +0.2% | 1.00x(?) |
MonteCarloE | 10562 | 10568 | +0.1% | 1.00x(?) |
SetUnion_OfObjects | 6600 | 6594 | -0.1% | 1.00x(?) |
StringHasSuffixUnicode | 63261 | 63246 | -0.0% | 1.00x(?) |
HashTest | 1747 | 1746 | -0.1% | 1.00x(?) |
SetIsSubsetOf_OfObjects | 524 | 524 | +0.0% | 1.00x |
ArrayAppend | 774 | 775 | +0.1% | 1.00x(?) |
DictionaryRemove | 4682 | 4700 | +0.4% | 1.00x(?) |
StringHasPrefixUnicode | 13751 | 13766 | +0.1% | 1.00x(?) |
LinkedList | 7239 | 7232 | -0.1% | 1.00x(?) |
RGBHistogramOfObjects | 22064 | 21996 | -0.3% | 1.00x(?) |
NSStringConversion | 794 | 794 | +0.0% | 1.00x |
RGBHistogram | 2840 | 2847 | +0.2% | 1.00x(?) |
ObjectiveCBridgeFromNSSetAnyObjectForced | 4602 | 4602 | +0.0% | 1.00x |
ArrayAppendSequence | 1062 | 1062 | +0.0% | 1.00x |
ArrayAppendArrayOfInt | 599 | 599 | +0.0% | 1.00x |
ArrayOfPOD | 182 | 182 | +0.0% | 1.00x |
SetUnion | 3009 | 3003 | -0.2% | 1.00x(?) |
Chars | 619 | 618 | -0.2% | 1.00x(?) |
StringBuilder | 1318 | 1321 | +0.2% | 1.00x(?) |
DeadArray | 182 | 182 | +0.0% | 1.00x |
ArrayValueProp2 | 6 | 6 | +0.0% | 1.00x |
BitCount | 1 | 1 | +0.0% | 1.00x |
AnyHashableWithAClass | 62740 | 62736 | -0.0% | 1.00x(?) |
SevenBoom | 1356 | 1359 | +0.2% | 1.00x(?) |
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced | 90239 | 90606 | +0.4% | 1.00x(?) |
StringWalk | 5884 | 5879 | -0.1% | 1.00x(?) |
ArrayValueProp | 6 | 6 | +0.0% | 1.00x |
ObjectiveCBridgeStubFromArrayOfNSString | 58524 | 58292 | -0.4% | 1.00x(?) |
ObjectiveCBridgeStubNSDateMutationRef | 11737 | 11767 | +0.3% | 1.00x(?) |
GlobalClass | 0 | 0 | +0.0% | 1.00x |
Memset | 235 | 235 | +0.0% | 1.00x |
Dictionary2OfObjects | 3395 | 3406 | +0.3% | 1.00x(?) |
ArrayValueProp4 | 6 | 6 | +0.0% | 1.00x |
TwoSum | 1578 | 1578 | +0.0% | 1.00x |
ObjectiveCBridgeStubNSDataAppend | 2476 | 2488 | +0.5% | 1.00x(?) |
ArrayValueProp3 | 6 | 6 | +0.0% | 1.00x |
ObjectiveCBridgeStubFromNSDate | 3667 | 3671 | +0.1% | 1.00x(?) |
Array2D | 2020 | 2032 | +0.6% | 0.99x(?) |
ObserverClosure | 1949 | 1966 | +0.9% | 0.99x(?) |
StaticArray | 2732 | 2758 | +0.9% | 0.99x(?) |
ProtocolDispatch2 | 158 | 159 | +0.6% | 0.99x |
StringHasPrefix | 729 | 733 | +0.6% | 0.99x(?) |
Join | 460 | 464 | +0.9% | 0.99x(?) |
ObserverUnappliedMethod | 2371 | 2388 | +0.7% | 0.99x(?) |
ObjectiveCBridgeStubURLAppendPathRef | 234780 | 236190 | +0.6% | 0.99x(?) |
ArrayAppendOptionals | 1232 | 1239 | +0.6% | 0.99x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced | 138100 | 138807 | +0.5% | 0.99x(?) |
ObjectiveCBridgeFromNSSetAnyObjectToString | 145992 | 148020 | +1.4% | 0.99x(?) |
SetExclusiveOr_OfObjects | 7936 | 7983 | +0.6% | 0.99x(?) |
ObjectiveCBridgeFromNSSetAnyObjectToStringForced | 108685 | 110320 | +1.5% | 0.99x(?) |
ObserverForwarderStruct | 887 | 898 | +1.2% | 0.99x(?) |
ObserverPartiallyAppliedMethod | 3339 | 3359 | +0.6% | 0.99x(?) |
PopFrontArray | 1095 | 1116 | +1.9% | 0.98x(?) |
ObjectiveCBridgeToNSSet | 15686 | 15943 | +1.6% | 0.98x(?) |
Calculator | 33 | 34 | +3.0% | 0.97x(?) |
146 | 3030294 | 3115153 | +2.8% | 0.97x |
ObjectiveCBridgeStubToNSDate | 13120 | 13669 | +4.2% | 0.96x(?) |
PopFrontArrayGeneric | 1117 | 1164 | +4.2% | 0.96x(?) |
Regression (0)
Improvement (0)
No Changes (147)
TEST | OLD_MIN | NEW_MIN | DELTA (%) | SPEEDUP |
---|---|---|---|---|
ObjectiveCBridgeFromNSArrayAnyObjectForced | 10741 | 10399 | -3.2% | 1.03x(?) |
ObjectiveCBridgeToNSArray | 30938 | 29966 | -3.1% | 1.03x(?) |
ObjectiveCBridgeStubToNSDate | 14255 | 13918 | -2.4% | 1.02x(?) |
ObjectiveCBridgeStubURLAppendPathRef | 238872 | 233183 | -2.4% | 1.02x(?) |
ObjectiveCBridgeToNSSet | 16498 | 16253 | -1.5% | 1.02x(?) |
NSDictionaryCastToSwift | 8582 | 8416 | -1.9% | 1.02x(?) |
ObjectiveCBridgeStubNSDateMutationRef | 14363 | 14076 | -2.0% | 1.02x(?) |
ObjectiveCBridgeToNSString | 1118 | 1111 | -0.6% | 1.01x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectToString | 229271 | 226706 | -1.1% | 1.01x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectForced | 7739 | 7679 | -0.8% | 1.01x(?) |
ArrayAppendGenericStructs | 1309 | 1300 | -0.7% | 1.01x(?) |
ErrorHandling | 3809 | 3790 | -0.5% | 1.01x(?) |
StaticArray | 35150 | 34961 | -0.5% | 1.01x(?) |
ObjectiveCBridgeFromNSSetAnyObject | 95979 | 95428 | -0.6% | 1.01x(?) |
OpenClose | 424 | 418 | -1.4% | 1.01x(?) |
ObjectiveCBridgeStubToNSDateRef | 3330 | 3312 | -0.5% | 1.01x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced | 147772 | 146298 | -1.0% | 1.01x(?) |
ObjectiveCBridgeStubDataAppend | 3350 | 3327 | -0.7% | 1.01x(?) |
ObjectiveCBridgeFromNSSetAnyObjectToStringForced | 124365 | 122787 | -1.3% | 1.01x(?) |
NSStringConversion | 3033 | 3014 | -0.6% | 1.01x(?) |
BitCount | 108 | 107 | -0.9% | 1.01x |
ArraySubscript | 5610 | 5628 | +0.3% | 1.00x(?) |
DictionarySwapOfObjects | 20785 | 20748 | -0.2% | 1.00x(?) |
StackPromo | 128078 | 128477 | +0.3% | 1.00x(?) |
ObjectiveCBridgeFromNSDictionaryAnyObject | 200745 | 200672 | -0.0% | 1.00x(?) |
RecursiveOwnedParameter | 10873 | 10872 | -0.0% | 1.00x(?) |
Integrate | 370 | 370 | +0.0% | 1.00x |
ClassArrayGetter | 1267 | 1266 | -0.1% | 1.00x(?) |
Array2D | 813597 | 813585 | -0.0% | 1.00x(?) |
Histogram | 11692 | 11695 | +0.0% | 1.00x(?) |
SortStrings | 2727 | 2729 | +0.1% | 1.00x(?) |
DictionaryBridge | 3943 | 3936 | -0.2% | 1.00x(?) |
ObjectiveCBridgeStubFromNSDateRef | 4027 | 4021 | -0.1% | 1.00x(?) |
MonteCarloPi | 53619 | 53626 | +0.0% | 1.00x(?) |
StringWithCString | 152655 | 152711 | +0.0% | 1.00x(?) |
ObjectiveCBridgeFromNSStringForced | 3081 | 3082 | +0.0% | 1.00x(?) |
Prims | 13684 | 13651 | -0.2% | 1.00x(?) |
SortLettersInPlace | 2578 | 2582 | +0.2% | 1.00x(?) |
DictionarySwap | 7543 | 7541 | -0.0% | 1.00x(?) |
PopFrontArray | 24428 | 24471 | +0.2% | 1.00x(?) |
Dictionary3OfObjects | 2234 | 2234 | +0.0% | 1.00x |
RangeAssignment | 13319 | 13293 | -0.2% | 1.00x(?) |
StringHasPrefix | 1561 | 1561 | +0.0% | 1.00x |
ByteSwap | 9 | 9 | +0.0% | 1.00x |
SuperChars | 262970 | 263119 | +0.1% | 1.00x(?) |
ArrayAppendLazyMap | 244947 | 245494 | +0.2% | 1.00x(?) |
XorLoop | 20235 | 20210 | -0.1% | 1.00x(?) |
ArrayAppendReserved | 3301 | 3302 | +0.0% | 1.00x(?) |
StringInterpolation | 15666 | 15685 | +0.1% | 1.00x(?) |
ObserverClosure | 7022 | 7035 | +0.2% | 1.00x(?) |
ObjectiveCBridgeStubToNSString | 1333 | 1336 | +0.2% | 1.00x(?) |
ArrayAppendStrings | 11857 | 11820 | -0.3% | 1.00x(?) |
ObjectiveCBridgeStubFromNSStringRef | 164 | 164 | +0.0% | 1.00x |
ObjectiveCBridgeStubFromNSString | 779 | 780 | +0.1% | 1.00x(?) |
ProtocolDispatch | 5564 | 5581 | +0.3% | 1.00x(?) |
ArrayLiteral | 1250 | 1251 | +0.1% | 1.00x(?) |
ProtocolDispatch2 | 443 | 443 | +0.0% | 1.00x |
Walsh | 13154 | 13165 | +0.1% | 1.00x(?) |
Dictionary3 | 1610 | 1606 | -0.2% | 1.00x(?) |
Dictionary2 | 4444 | 4426 | -0.4% | 1.00x(?) |
StrComplexWalk | 8075 | 8108 | +0.4% | 1.00x(?) |
SetIntersect_OfObjects | 14015 | 14034 | +0.1% | 1.00x(?) |
Join | 1460 | 1459 | -0.1% | 1.00x(?) |
ArrayOfRef | 9120 | 9104 | -0.2% | 1.00x(?) |
ArrayAppendOptionals | 1307 | 1312 | +0.4% | 1.00x(?) |
DictionaryOfObjects | 4876 | 4871 | -0.1% | 1.00x(?) |
PopFrontUnsafePointer | 242574 | 242697 | +0.1% | 1.00x(?) |
StringEqualPointerComparison | 9708 | 9715 | +0.1% | 1.00x(?) |
CaptureProp | 117756 | 117813 | +0.1% | 1.00x(?) |
PolymorphicCalls | 1150 | 1149 | -0.1% | 1.00x(?) |
RC4 | 9394 | 9395 | +0.0% | 1.00x(?) |
ObjectiveCBridgeStubToNSStringRef | 156 | 156 | +0.0% | 1.00x |
Calculator | 983 | 982 | -0.1% | 1.00x(?) |
MapReduce | 45341 | 45452 | +0.2% | 1.00x(?) |
ObjectiveCBridgeStubDateMutation | 517 | 517 | +0.0% | 1.00x |
AngryPhonebook | 2973 | 2982 | +0.3% | 1.00x(?) |
IterateData | 10615 | 10603 | -0.1% | 1.00x(?) |
Hanoi | 19823 | 19805 | -0.1% | 1.00x(?) |
ArrayOfGenericPOD | 3707 | 3703 | -0.1% | 1.00x(?) |
DictionaryRemoveOfObjects | 46805 | 46940 | +0.3% | 1.00x(?) |
UTF8Decode | 43557 | 43536 | -0.1% | 1.00x(?) |
SortStringsUnicode | 9276 | 9270 | -0.1% | 1.00x(?) |
SetIsSubsetOf | 2444 | 2442 | -0.1% | 1.00x(?) |
Dictionary | 2138 | 2138 | +0.0% | 1.00x |
NopDeinit | 58083 | 58096 | +0.0% | 1.00x(?) |
ObjectiveCBridgeStubToArrayOfNSString | 29857 | 29747 | -0.4% | 1.00x(?) |
ObjectiveCBridgeFromNSArrayAnyObject | 79173 | 79359 | +0.2% | 1.00x(?) |
SetIntersect | 15203 | 15174 | -0.2% | 1.00x(?) |
SetExclusiveOr | 30514 | 30535 | +0.1% | 1.00x(?) |
ObjectiveCBridgeStubNSDateRefAccess | 1234 | 1233 | -0.1% | 1.00x(?) |
StrToInt | 5897 | 5901 | +0.1% | 1.00x(?) |
ArrayInClass | 3956 | 3958 | +0.1% | 1.00x(?) |
ArrayOfGenericRef | 10051 | 10049 | -0.0% | 1.00x(?) |
StringHasSuffix | 1577 | 1577 | +0.0% | 1.00x |
Phonebook | 63909 | 63677 | -0.4% | 1.00x(?) |
ObjectiveCBridgeStubDateAccess | 1064 | 1066 | +0.2% | 1.00x(?) |
Sim2DArray | 14772 | 14789 | +0.1% | 1.00x(?) |
SetExclusiveOr_OfObjects | 46918 | 46717 | -0.4% | 1.00x(?) |
ArrayAppendRepeatCol | 212728 | 212733 | +0.0% | 1.00x(?) |
ObjectiveCBridgeToNSDictionary | 17081 | 17080 | -0.0% | 1.00x(?) |
MonteCarloE | 108788 | 108722 | -0.1% | 1.00x(?) |
SetUnion_OfObjects | 34279 | 34249 | -0.1% | 1.00x(?) |
StringHasSuffixUnicode | 64766 | 64789 | +0.0% | 1.00x(?) |
HashTest | 5248 | 5250 | +0.0% | 1.00x(?) |
SetIsSubsetOf_OfObjects | 2220 | 2219 | -0.1% | 1.00x(?) |
ArrayAppend | 3554 | 3554 | +0.0% | 1.00x |
DictionaryRemove | 17546 | 17502 | -0.2% | 1.00x(?) |
StringHasPrefixUnicode | 15590 | 15621 | +0.2% | 1.00x(?) |
LinkedList | 27601 | 27611 | +0.0% | 1.00x(?) |
RGBHistogramOfObjects | 93576 | 93458 | -0.1% | 1.00x(?) |
RGBHistogram | 44022 | 43906 | -0.3% | 1.00x(?) |
ObjectiveCBridgeFromNSSetAnyObjectForced | 7517 | 7481 | -0.5% | 1.00x(?) |
ArrayAppendSequence | 105375 | 105434 | +0.1% | 1.00x(?) |
ArrayAppendArrayOfInt | 641 | 641 | +0.0% | 1.00x |
ArrayOfPOD | 2510 | 2512 | +0.1% | 1.00x(?) |
SetUnion | 18475 | 18492 | +0.1% | 1.00x(?) |
Chars | 5021 | 5014 | -0.1% | 1.00x(?) |
StringBuilder | 2731 | 2733 | +0.1% | 1.00x(?) |
ObserverForwarderStruct | 5211 | 5212 | +0.0% | 1.00x(?) |
146 | 6085190 | 6065435 | -0.3% | 1.00x |
DeadArray | 121076 | 120547 | -0.4% | 1.00x(?) |
ArrayValueProp2 | 3129 | 3128 | -0.0% | 1.00x(?) |
SevenBoom | 1508 | 1501 | -0.5% | 1.00x(?) |
StringWalk | 22138 | 22108 | -0.1% | 1.00x(?) |
ArrayValueProp | 2609 | 2606 | -0.1% | 1.00x(?) |
ObjectiveCBridgeStubFromArrayOfNSString | 59364 | 59346 | -0.0% | 1.00x(?) |
ObjectiveCBridgeFromNSString | 5156 | 5158 | +0.0% | 1.00x(?) |
GlobalClass | 0 | 0 | +0.0% | 1.00x |
Memset | 20956 | 20965 | +0.0% | 1.00x(?) |
Dictionary2OfObjects | 6292 | 6306 | +0.2% | 1.00x(?) |
ArrayValueProp4 | 3018 | 3018 | +0.0% | 1.00x |
TwoSum | 6569 | 6597 | +0.4% | 1.00x(?) |
ObjectiveCBridgeStubNSDataAppend | 2808 | 2818 | +0.4% | 1.00x(?) |
ArrayValueProp3 | 3079 | 3079 | +0.0% | 1.00x |
ObserverPartiallyAppliedMethod | 8346 | 8357 | +0.1% | 1.00x(?) |
ObjectiveCBridgeFromNSArrayAnyObjectToString | 123020 | 124362 | +1.1% | 0.99x(?) |
ObjectAllocation | 557 | 561 | +0.7% | 0.99x(?) |
ObserverUnappliedMethod | 8707 | 8755 | +0.6% | 0.99x(?) |
PopFrontArrayGeneric | 9566 | 9618 | +0.5% | 0.99x(?) |
AnyHashableWithAClass | 77657 | 78661 | +1.3% | 0.99x(?) |
ObjectiveCBridgeFromNSArrayAnyObjectToStringForced | 93211 | 94002 | +0.8% | 0.99x(?) |
ObjectiveCBridgeStubFromNSDate | 3836 | 3891 | +1.4% | 0.99x(?) |
NSError | 677 | 689 | +1.8% | 0.98x(?) |
DictionaryLiteral | 16565 | 16819 | +1.5% | 0.98x(?) |
ObjectiveCBridgeStubURLAppendPath | 236741 | 241488 | +2.0% | 0.98x(?) |
ObjectiveCBridgeFromNSSetAnyObjectToString | 161442 | 164030 | +1.6% | 0.98x(?) |
TypeFlood | 179 | 186 | +3.9% | 0.96x(?) |
%t8 = tuple_extract %t6 : $(Builtin.Int32, Builtin.Int1), 1 | ||
cond_fail %t8 : $Builtin.Int1 | ||
%af1 = builtin "cmp_slt_Int32"(%t7 : $Builtin.Int32, %z0 : $Builtin.Int32) : $Builtin.Int1 | ||
cond_fail %af1 : $Builtin.Int1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tests the condition:
Iteration count + 1 < 0 (start)
Can you add tests for the other conditions to the test case?
Other than that. LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done - added the other conditions to test case and confirmed they fail with old master / pass with PR.
ffdc4a8
to
fee71ca
Compare
@swift-ci Please smoke test |
All Linux tests have been failing for the last few hours, not related to this PR, will re-run after Linux gets back up |
@swift-ci Please smoke test |
radar rdar://problem/29056452
Encountered a pattern of always-false array iteration count comparisons:
Iteration count < 0 (start)
Iteration count + 1 < 0 (start)
Iteration count + 1 == 0 (start)
Iteration count +1 <= 0 (start)
This PR adds support for such cases, similar to the already present always-true peephole.
@moiseev Please use this PR to benchmark your branch.