From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10399 invoked by alias); 17 Oct 2008 20:39:57 -0000 Received: (qmail 10381 invoked by uid 22791); 17 Oct 2008 20:39:50 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 17 Oct 2008 20:38:51 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id m9HKcoQS031914 for ; Fri, 17 Oct 2008 16:38:50 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m9HKcnf7030112 for ; Fri, 17 Oct 2008 16:38:49 -0400 Received: from stone.twiddle.home (vpn-51-35.sfbay.redhat.com [10.14.51.35]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m9HKclQ8023782 for ; Fri, 17 Oct 2008 16:38:48 -0400 Message-ID: <48F8F7D7.9020505@redhat.com> Date: Sat, 18 Oct 2008 02:02:00 -0000 From: Richard Henderson User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: [trans-mem] rewrite transaction lowering Content-Type: multipart/mixed; boundary="------------070302050200040801080702" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-10/txt/msg00765.txt.bz2 This is a multi-part message in MIME format. --------------070302050200040801080702 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 949 The lowering of transactions are now much more to my liking. It's a 5 step process, described in detail in a block comment at the beginning of gtm-low.c. The important functional changes are (1) we properly commit the transaction when we leave the region via an exception, and (2) we accurately describe the CFG, and the abnormal edges created by the longjmp used to restart or abort the transaction. Still to do is rtl expansion of the TM_LOAD/STORE nodes, rewriting creation of the transactional clones as real IPA pass, duplicating the transaction region without annotations as a fast-path when the transaction gets (re-)started in sequential mode. What I generate is no longer compatible with TinySTM. It's closer to what I believe the final ABI should look like. At some point I'll either import some existing GPL STM library (TinySTM, unless someone has a better suggestion) or start a new one from scratch. We'll see... r~ --------------070302050200040801080702 Content-Type: text/plain; name="z.txt" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="z.txt" Content-length: 72204 ICAgICAgICAqIGV4Y2VwdC5jIChzdHJ1Y3QgZWhfcmVnaW9uKTogQWRkIEVS VF9UUkFOU0FDVElPTi4KICAgICAgICAoZ2VuX2VoX3JlZ2lvbik6IEFsbG93 IGlmIGZsYWdfdG0uCiAgICAgICAgKGdlbl9laF9yZWdpb25fdHJhbnNhY3Rp b24sIGdldF9laF9yZWdpb25fZnJvbV9udW1iZXIpOiBOZXcuCiAgICAgICAg KHJlbW92ZV9laF9oYW5kbGVyKTogRXhwb3J0LgogICAgICAgIChjdXJyZW50 X2Z1bmN0aW9uX2hhc19leGNlcHRpb25faGFuZGxlcnMpOiBIYW5kbGUgRVJU X1RSQU5TQUNUSU9OLgogICAgICAgIChidWlsZF9wb3N0X2xhbmRpbmdfcGFk cywgcmVhY2hhYmxlX25leHRfbGV2ZWwpOiBMaWtld2lzZS4KICAgICAgICAo Y29sbGVjdF9vbmVfYWN0aW9uX2NoYWluKTogTGlrZXdpc2UuCiAgICAgICAg KGZvcmVhY2hfcmVhY2hhYmxlX3RyYW5zYWN0aW9uKTogTmV3LgogICAgICAg ICogZXhjZXB0Lmg6IEFkZCBuZXcgZXhwb3J0ZWQgZGVjbHMuCiAgICAgICAg KiBnaW1wbGUtbG93LmMgKHN0cnVjdCBsb3dlcl9kYXRhKTogUmVtb3ZlIGlu X3RyYW5zYWN0aW9uLgogICAgICAgIChsb3dlcl90bV9hdG9taWMsIHJlY29y ZF92YXJzX2ludG9fdG0p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iAKKyAgICAgICAgICAgICAgY2FzZSAneCc6CisgICAgICAgICAgICAg ICAgcHBfc2NhbGFyIChidWZmZXIsICIleCIsIHZhX2FyZyAoYXJncywgaW50 KSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKICAgICAgICAgICAgICAg Y2FzZSAnKyc6CiAgICAgICAgICAgICAgICAgc3BjICs9IDI7CiAgICAgICAg ICAgICAgICAgbmV3bGluZV9hbmRfaW5kZW50IChidWZmZXIsIHNwYyk7CkBA IC0zNTAsOSArMzU1LDE5IEBAIGR1bXBfYmluYXJ5X3JocyAocHJldHR5X3By aW50ZXIgKmJ1ZmZlciwKIHN0YXRpYyB2b2lkCiBkdW1wX2dpbXBsZV9hc3Np Z24gKHByZXR0eV9wcmludGVyICpidWZmZXIsIGdpbXBsZSBncywgaW50IHNw YywgaW50IGZsYWdzKQogeworICBlbnVtIHRyZWVfY29kZSBjb2RlOworCisg IC8qIERvbid0IGJ5cGFzcyB0aGUgdHJhbnNhY3Rpb25hbCBtYXJrZXJzIGxp a2UKKyAgICAgZ2ltcGxlX2Fzc2lnbl9yaHNfY29kZSB3b3VsZC4gICovCisg IGNvZGUgPSBnaW1wbGVfZXhwcl9jb2RlIChncyk7CisgIGlmIChjb2RlICE9 IFRNX0xPQUQgJiYgY29kZSAhPSBUTV9TVE9SRQorICAgICAgJiYgZ2V0X2dp bXBsZV9yaHNfY2xhc3MgKGNvZGUpID09IEdJTVBMRV9TSU5HTEVfUkhTKQor ICAgIGNvZGUgPSBUUkVFX0NPREUgKGdpbXBsZV9hc3NpZ25fcmhzMSAoZ3Mp KTsKKwogICBpZiAoZmxhZ3MgJiBUREZfUkFXKQogICAgIHsKICAgICAgIHRy ZWUgbGFzdDsKKwogICAgICAgaWYgKGdpbXBsZV9udW1fb3BzIChncykgPT0g MikKICAgICAgICAgbGFzdCA9IE5VTExfVFJFRTsKICAgICAgIGVsc2UgaWYg KGdpbXBsZV9udW1fb3BzIChncykgPT0gMykKQEAgLTM2MSw4ICszNzYsOCBA QCBkdW1wX2dpbXBsZV9hc3NpZ24gKHByZXR0eV9wcmludGVyICpidWZmCiAg ICAgICAgIGdjY191bnJlYWNoYWJsZSAoKTsKIAogICAgICAgZHVtcF9naW1w bGVfZm10IChidWZmZXIsIHNwYywgZmxhZ3MsICIlRyA8JXMsICVULCAlVCwg JVQ+IiwgZ3MsCi0gICAgICAgICAgICAgICAgICAgICAgIHRyZWVfY29kZV9u YW1lW2dpbXBsZV9hc3NpZ25fcmhzX2NvZGUgKGdzKV0sCi0gICAgICAgICAg ICAgICAgICAgICAgIGdpbXBsZV9hc3NpZ25fbGhzIChncyksIGdpbXBsZV9h c3NpZ25fcmhzMSAoZ3MpLCBsYXN0KTsKKyAgICAgICAgICAgICAgICAgICAg ICAgdHJlZV9jb2RlX25hbWVbY29kZV0sIGdpbXBsZV9hc3NpZ25fbGhzIChn cyksCisJCSAgICAgICBnaW1wbGVfYXNzaWduX3JoczEgKGdzKSwgbGFzdCk7 CiAgICAgfQogICBlbHNlCiAgICAgewpAQCAtMzcyLDYgKzM4NywxMSBAQCBk dW1wX2dpbXBsZV9hc3NpZ24gKHByZXR0eV9wcmludGVyICpidWZmCiAJICBw cF9zcGFjZSAoYnVmZmVyKTsKIAkgIHBwX2NoYXJhY3RlciAoYnVmZmVyLCAn PScpOwogCisJICBpZiAoY29kZSA9PSBUTV9MT0FEKQorCSAgICBwcF9zdHJp bmcgKGJ1ZmZlciwgInt0bV9sb2FkfSIpOworCSAgZWxzZSBpZiAoY29kZSA9 PSBUTV9TVE9SRSkKKwkgICAgcHBfc3RyaW5nIChidWZmZXIsICJ7dG1fc3Rv cmV9Iik7CisKIAkgIGlmIChnaW1wbGVfYXNzaWduX25vbnRlbXBvcmFsX21v dmVfcCAoZ3MpKQogCSAgICBwcF9zdHJpbmcgKGJ1ZmZlciwgIntudH0iKTsK IApAQCAtMTAxMywxMSArMTAzMywxOCBAQCBzdGF0aWMgdm9pZAogZHVtcF9n aW1wbGVfdG1fYXRv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