WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
162350
B3 should have a Depend operation
https://bugs.webkit.org/show_bug.cgi?id=162350
Summary
B3 should have a Depend operation
Filip Pizlo
Reported
2016-09-21 11:16:30 PDT
On ARM, there's a goofy way to force to loads to be dependent. Say you have two loads: a = *p b = *q You can make them dependent by doing: a = *p b = q[a ^ a] Obviously, you can't say BitXor(a, a) since that would get strength-reduced away. But we could introduce a Depend operation like this: a = *p b = *Depend(q, a) On x86, this operation could get blown away just before lowering to Air. On ARM, this operation would turn into the BitXor hack. Intriguingly, this Depend operation would be useful even on x86 because it would let us express a load-load fence without pessimizing codegen too much.
Attachments
Add attachment
proposed patch, testcase, etc.
JF Bastien
Comment 1
2016-09-21 11:50:08 PDT
Dependency should also support straight pointer chasing dependency. The key is that the compiler can't dematerialize the original pointer load. If you express this dependency then you can skip acquire fences as well. The address dependency rule is an extra complication for non-pointer-chasing dependencies.
Filip Pizlo
Comment 2
2016-09-21 12:08:27 PDT
(In reply to
comment #1
)
> Dependency should also support straight pointer chasing dependency. The key > is that the compiler can't dematerialize the original pointer load. If you > express this dependency then you can skip acquire fences as well. > > The address dependency rule is an extra complication for non-pointer-chasing > dependencies.
I think that B3 already supports pointer chasing dependencies correctly. Depend fills in the non-pointer-chasing case.
Filip Pizlo
Comment 3
2016-09-21 14:06:40 PDT
It's interesting that the way that B3 defines a load-load dependency as: load A load-depends on load B if the address of A cannot be computed without B. The Depend operation is only necessary if you want to build a dependency like this for code where B is unnecessary for computing the address of A. This is going to be fun to document.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug