IonMonkey: eliminate redundant lower bound checks

NEW
Unassigned

Status

()

7 years ago
5 years ago

People

(Reporter: evilpie, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [ion:t])

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
For code like this we currently emit three lower bound checks.

var n = 0;
for (var i = 0; i < (a.length - 4); i++) {
  n = a[i] + a[i + 1] + a[i + 2];
}

We should just more or less duplicate ion::EliminateRedundantBoundsChecks for MBoundsCheckLower.
(Reporter)

Comment 1

7 years ago
Created attachment 642396 [details] [diff] [review]
WIP

Pretty straight forward, just duplicated to the logic for MBoundsCheck in EliminateRedundantBoundsChecks the pass and adopted it for MBoundsCheckLower.
Assignee: general → evilpies
Status: NEW → ASSIGNED
Blocks: 705294
No longer blocks: 650180
Whiteboard: [ion:t]
(Reporter)

Comment 2

6 years ago
I think Brian changed a lot of this stuff recently. Is this useful?
Hmm, I think this could be used to eliminate checks, but MBoundsCheckLower will only be introduced when we were able to hoist a check from the loop and thus the eliminated checks will always be in loop preheaders rather than the loop body.
(Reporter)

Comment 4

6 years ago
This could be an easy fix.
Assignee: evilpies → general
(Reporter)

Updated

6 years ago
Status: ASSIGNED → NEW
Assignee: general → nobody
You need to log in before you can comment on or make changes to this bug.