Bug 122170 - FTL: split overflow checks into non-overflow arithmetic and an additional call to the overflow intrinsic check.
Summary: FTL: split overflow checks into non-overflow arithmetic and an additional cal...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-01 12:35 PDT by Nadav Rotem
Modified: 2013-10-01 16:17 PDT (History)
3 users (show)

See Also:


Attachments
Patch (7.96 KB, patch)
2013-10-01 12:41 PDT, Nadav Rotem
no flags Details | Formatted Diff | Diff
Patch (7.96 KB, patch)
2013-10-01 13:43 PDT, Nadav Rotem
no flags Details | Formatted Diff | Diff
Patch (7.99 KB, patch)
2013-10-01 15:05 PDT, Nadav Rotem
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nadav Rotem 2013-10-01 12:35:39 PDT
FTL: split overflow checks into non-overflow arithmetic and an additional call to the overflow intrinsic check.
Comment 1 Nadav Rotem 2013-10-01 12:41:51 PDT
Created attachment 213113 [details]
Patch
Comment 2 Geoffrey Garen 2013-10-01 12:58:39 PDT
Comment on attachment 213113 [details]
Patch

r=me

Does SelectionDAG also catch the multiply case?
Comment 3 Geoffrey Garen 2013-10-01 13:00:18 PDT
Comment on attachment 213113 [details]
Patch

Sorry, one style nit: The "Reviewed by" line needs to be right under the bug name/URL pair. I think some of our automated tools expect to find it there.
Comment 4 Nadav Rotem 2013-10-01 13:04:01 PDT
Okay. Should I resubmit ?
Comment 5 Nadav Rotem 2013-10-01 13:17:11 PDT
Yes. It works with Mul, Add and Inc.   I am sure that we are missing some patterns but we can fix them as we go. 

This:

function foo() {
  var sum = 1
  while (sum < 100000000)
    sum *= 10
}

Becomes this:

LBB0_1:                                       ## =>This Inner Loop Header: Depth=1
	imull	$10, %eax, %ecx
	jo	LBB0_7

## BB#2:                                ## %OSR exit continuation for @11<Int32>
                                              ##   in Loop: Header=BB0_1 Depth=1
	testl	%ecx, %ecx
	je	LBB0_3
LBB0_4:                                 ## %ArithMul continuation
                                             ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$100000000, %ecx        ## imm = 0x5F5E100
	movl	%ecx, %eax
	jl	LBB0_1
	jmp	LBB0_5
Comment 6 Geoffrey Garen 2013-10-01 13:36:54 PDT
> Okay. Should I resubmit ?

Yes please.
Comment 7 Nadav Rotem 2013-10-01 13:43:59 PDT
Created attachment 213117 [details]
Patch
Comment 8 Nadav Rotem 2013-10-01 14:05:22 PDT
Added commit-queue=?.
Comment 9 Filip Pizlo 2013-10-01 14:09:21 PDT
Comment on attachment 213117 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=213117&action=review

Looks great!

> Source/JavaScriptCore/ChangeLog:36
> +LBB0_1:                                 ## %OSR exit continuation for @24<Int32>
> +                                        ## =>This Inner Loop Header: Depth=1
> +    movl  %ecx, %esi
> +    incl  %esi
> +    jo  LBB0_4

I would indent this.
Comment 10 Nadav Rotem 2013-10-01 14:37:04 PDT
Indent the commit message ? In what way ?
Comment 11 Filip Pizlo 2013-10-01 14:39:54 PDT
(In reply to comment #10)
> Indent the commit message ? In what way ?

The ChangeLog messages should have at least eight-space indent except for the header ("2013-10-01  Nadav Rotem  <nrotem@apple.com>").  So this part of your patch:

+LBB0_1:                                 ## %OSR exit continuation for @24<Int32>
+                                        ## =>This Inner Loop Header: Depth=1
+    movl  %ecx, %esi
+    incl  %esi
+    jo  LBB0_4

Should be:

+        LBB0_1:                                 ## %OSR exit continuation for @24<Int32>
+                                                ## =>This Inner Loop Header: Depth=1
+            movl  %ecx, %esi
+            incl  %esi
+            jo  LBB0_4

We have some scripts that try to parse changelog's, so sticking to the format is usually a good idea.
Comment 12 Nadav Rotem 2013-10-01 15:05:00 PDT
Created attachment 213124 [details]
Patch
Comment 13 WebKit Commit Bot 2013-10-01 16:17:31 PDT
Comment on attachment 213124 [details]
Patch

Clearing flags on attachment: 213124

Committed r156746: <http://trac.webkit.org/changeset/156746>
Comment 14 WebKit Commit Bot 2013-10-01 16:17:33 PDT
All reviewed patches have been landed.  Closing bug.