From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3023 invoked by alias); 31 Jul 2007 12:37:06 -0000 Received: (qmail 3015 invoked by uid 22791); 31 Jul 2007 12:37:05 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 31 Jul 2007 12:37:03 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.13.8/8.13.8) with ESMTP id l6VCb0Oc401852 for ; Tue, 31 Jul 2007 12:37:00 GMT Received: from d12av04.megacenter.de.ibm.com (d12av04.megacenter.de.ibm.com [9.149.165.229]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.4) with ESMTP id l6VCatAH2171088 for ; Tue, 31 Jul 2007 14:37:00 +0200 Received: from d12av04.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l6VCaf56024714 for ; Tue, 31 Jul 2007 14:36:42 +0200 Received: from d12mc102.megacenter.de.ibm.com (d12mc102.megacenter.de.ibm.com [9.149.167.114]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l6VCafk1024205 for ; Tue, 31 Jul 2007 14:36:41 +0200 Subject: [PATCH] conditional load hoisting To: gcc-patches@gcc.gnu.org X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 Message-ID: From: Tehila Meyzels Date: Tue, 31 Jul 2007 12:49:00 -0000 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=4DBBF9BADFD76BBD8f9e8a93df938690918c4DBBF9BADFD76BBD" Content-Disposition: inline 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: 2007-07/txt/msg02170.txt.bz2 --0__=4DBBF9BADFD76BBD8f9e8a93df938690918c4DBBF9BADFD76BBD Content-type: text/plain; charset=US-ASCII Content-length: 1309 Hi, This patch is aimed to perform conditional load hoisting (in tree level), to increase opportunities for if-conversion (in RTL, ifcvt.c), It was written for a GCC 4.1.1 based compiler, and I'm posting it, as a reference, for a discussion I want to raise with respect tree-ssa-if-conversion improvements (coming up) . I'm not submitting this for inclusion in GCC as is, since I think it should be rewritten to be part of tree-if-conv (details will followed). This patch performs hoisting of a load insn from the THEN or the ELSE block (one of them, where it appears) to the IF block above. It has several restrictions when to hoist, including a checking that the BBs are if-convertable. For example: Replace: bb0: if (c) goto bb1; else goto bb2; bb1: a = arr[index]; bb2: with bb0: a' = arr[index]; if (c) goto bb1; else goto bb2; bb1: tmp = a'; bb2: In order to activate this transformation, 2 flags should be enabled: 1. -ftree-clhoist (the pass flag) 2. -fsched-spec-load-dangerous - since we create speculative loads, which is dangerous. Tehila. (See attached file: cond_load_hoist.diff) ----------------------------------------------------------------------------- Tehila Meyzels Tel: 972-4-829-6190 Email: tehila@il.ibm.com --0__=4DBBF9BADFD76BBD8f9e8a93df938690918c4DBBF9BADFD76BBD Content-type: application/octet-stream; name="cond_load_hoist.diff" Content-Disposition: attachment; filename="cond_load_hoist.diff" Content-transfer-encoding: base64 Content-length: 16174 SW5kZXg6IGdjYy9nY2MvZG9jL3Bhc3Nlcy50ZXhpCj09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT0KLS0tIGdjYy9nY2MvZG9jL3Bhc3Nlcy50ZXhpCShyZXZpc2lv biA4MzMpCisrKyBnY2MvZ2NjL2RvYy9wYXNzZXMudGV4aQkod29ya2luZyBj b3B5KQpAQCAtMzA3LDYgKzMwNywxMyBAQAogSXQgaXMgbG9jYXRlZCBpbiBA ZmlsZXt0cmVlLXNzYS1waGlvcHQuY30gYW5kIGlzIGRlc2NyaWJlZC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GVjayB0aGF0IGl0IGlzIHNhZmUgdG8gbW92ZQorICAgICBpdC4gICovCisK KyAgZm9yIChic2kgPSBic2lfc3RhcnQgKGJiKTsgIWJzaV9lbmRfcCAoYnNp KTsgYnNpX25leHQgKCZic2kpKQorICAgIHsKKyAgICAgIHRyZWUgc3RtdDsK KworICAgICAgc3RtdCA9IGJzaV9zdG10IChic2kpOworCisgICAgICBpZiAo Z2V0X2NhbGxfZXhwcl9pbiAoc3RtdCkpCisJcmV0dXJuIGZhbHNlOworCisg ICAgICBpZiAoVFJFRV9DT0RFIChzdG10KSAhPSBNT0RJRllfRVhQUikKKwlj b250aW51ZTsKKworICAgICAgaWYgKCFaRVJPX1NTQV9PUEVSQU5EUyAoc3Rt dCwgU1NBX09QX1ZJUlRVQUxfREVGUykpIC8qIHN0b3JlICAqLworCXJldHVy biBmYWxzZTsKKworICAgICAgaWYgKCFaRVJPX1NTQV9PUEVSQU5EUyAoc3Rt dCwgU1NBX09QX1ZJUlRVQUxfVVNFUykpIC8qIGxvYWQgICovCisgICAgICAg IHsKKwkgIHRyZWUgbGhzLCByaHM7CisJICBzdG10X2Fubl90IGFubjsKKwor CSAgYW5uID0gc3RtdF9hbm4gKHN0bXQpOworCSAgbGhzID0gVFJFRV9PUEVS QU5EIChzdG10LCAwKTsKKwkgIHJocyA9IFRSRUVfT1BFUkFORCAoc3RtdCwg MSk7CQorCisJICAvKiBXZSBkb24ndCBzdXBwb3J0IGxvYWQtaG9pc3Rpbmcg b2YgbG9hZHMgdGhhdCBhcmVuJ3QgZnJvbSBhbiAKKwkgICAgIGFycmF5LiAg Ki8KKwkgIGlmIChUUkVFX0NPREUgKHJocykgIT0gQVJSQVlfUkVGKSAKKwkg ICAgcmV0dXJuIGZhbHNlOworCisgICAgICAgICAgLyogVmVyaWZ5IHRoYXQg dGhpcyBsb2FkLWZyb20tYXJyYXkgY2FuIGJlIG1vdmVkLiAgKi8KKwkgIGVs c2UKKwkgICAgeworCSAgICAgIGlmIChUUkVFX1NJREVfRUZGRUNUUyAobGhz KQorCSAgICAgICAgICB8fCBUUkVFX0NPREUgKGxocykgPT0gRVhDX1BUUl9F WFBSCisJICAgICAgICAgIHx8IFRSRUVfQ09ERSAobGhzKSA9PSBGSUxURVJf RVhQUiAKKwkgICAgICAgICAgfHwgYW5uLT5oYXNfdm9sYXRpbGVfb3BzCisJ CSAgfHwgIWFycmF5X2FscmVhZHlfZGVmaW5lZF9wIChyaHMsIGJiKSkKKyAg ICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIHRydWU7Cit9CisKKwogLyog VGhpcyBwYXNzIHRyaWVzIHRvIHJlcGxhY2UgYW4gaWYtdGhlbi1lbHNlIGJs b2NrIHdpdGggYW4KICAgIGFzc2lnbm1lbnQuICBXZSBoYXZlIGZvdXIga2lu ZHMgb2YgdHJhbnNmb3JtYXRpb25zLiAgU29tZSBvZiB0aGVzZQogICAgdHJh bnNmb3JtYXRpb25zIGFyZSBhbHNvIHBlcmZvcm1lZCBieSB0aGUgaWZjdnQg UlRMIG9wdGltaXplci4KQEAgLTEzNiwxMCArMjI1LDUxIEBACiBzdGF0aWMg dm9pZAogdHJlZV9zc2FfcGhpb3B0ICh2b2lkKQogeworICB0cmVlX3NzYV9w aGlvcHRfd29ya2VyIChmYWxzZSk7Cit9CisKKy8qIFRoaXMgcGFzcyB0cmll cyB0byB0cmFuc2Zvcm0gY29uZGl0aW9uYWwgbG9hZHMgaW50byB1bmNvbmRp dGlvbmFsCisgICBvbmVzLCBieSBob2lzdGluZyB0aGUgbG9hZCB0byB0aGUg aWYgYmIuICBJbiBwYXJ0aWN1bGFyLCBpdCByZXBsYWNlcyB0aGlzOgorCisg ICAgIGJiMDoKKyAgICAgICBpZiAoY29uZCkgZ290byBiYjE7IGVsc2UgZ290 byBiYjI7CisgICAgIGJiMToKKyAgICAgICBMSFMgPSBhcnJbaW5kZXhdOwor ICAgICBiYjI6CisgICAgICAgCisgICB3aXRoCisKKyAgICAgYmIwOgorICAg ICAgIExIUycgPSBhcnJbaW5kZXhdOworICAgICAgIGlmIChjb25kKSBnb3Rv IGJiMTsgZWxzZSBnb3RvIGJiMjsKKyAgICAgYmIxOgorICAgICAgIHRtcCA9 IExIUyc7CisgICAgIGJiMjoKKworICAgVGhpcyB0cmFuc2Zvcm1hdGlvbiBj YW4gb25seSBiZSBkb25lIHVuZGVyIHNldmVyYWwgY29uc3RyYWludHMsCisg ICBkb2N1bWVudGVkIGJlbG93LiAgKi8KKworc3RhdGljIHZvaWQKK3RyZWVf c3NhX2NsX2hvaXN0ICh2b2lkKQoreworICB0cmVlX3NzYV9waGlvcHRfd29y a2VyICh0cnVlKTsKK30KKworCisvKiBUaGUgY29yZSByb3V0aW5lIG9mIGNv bmRpdGlvbmFsIGxvYWQgcmVwbGFjZW1lbnQgYW5kIG5vcm1hbAorICAgcGhp IG9wdGltaXphdGlvbnMuICBCb3RoIHNoYXJlIG11Y2ggb2YgdGhlIGluZnJh c3RydWN0dXJlIGluIGhvdworICAgdG8gbWF0Y2ggYXBwbGljYWJsZSBiYXNp YyBibG9jayBwYXR0ZXJucy4gIERPX0xPQURfSE9JU1QgaXMgdHJ1ZQorICAg d2hlbiB3ZSB3YW50IHRvIGRvIGNvbmRpdGlvbmFsIGxvYWQgcmVwbGFjZW1l bnQsIGZhbHNlIG90aGVyd2lzZS4gICovCitzdGF0aWMgdm9pZAordHJlZV9z c2FfcGhpb3B0X3dvcmtlciAoYm9vbCBkb19sb2FkX2hvaXN0KQorewogICBi YXNpY19ibG9jayBiYjsKICAgYmFzaWNfYmxvY2sgKmJiX29yZGVyOwogICB1 bnNpZ25lZCBuLCBpOworICBib29sIGlmX3RoZW5fZWxzZTsKIAorICBpZl90 aGVuX2Vsc2UgPSBmYWxzZTsKKwogICAvKiBTZWFyY2ggZXZlcnkgYmFzaWMg YmxvY2sgZm9yIENPTkRfRVhQUiB3ZSBtYXkgYmUgY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W50IChiYiwgYmIyKTsKKwkgIGNvbnRpbnVlOworCX0KKwogICAgICAg cGhpID0gcGhpX25vZGVzIChiYjIpOwogCiAgICAgICAvKiBDaGVjayB0byBt YWtlIHN1cmUgdGhhdCB0aGVyZSBpcyBvbmx5IG9uZSBQSEkgbm9kZS4KQEAg LTk4Nyw2ICsxMTQwLDk4IEBACiB9CiAKIAorLyogRG8gdGhlIG1haW4gd29y ayBvZiBjb25kaXRpb25hbCBsb2FkIGhvaXN0aW5nLiBXZSBhbHJlYWR5IGtu b3cgdGhhdCB0aGUgCisgICByZWNvZ25pemVkIHBhdHRlcm4gbG9va3MgbGlr ZSBvbmUgb2YgdGhlIG9wdGlvbnM6CisKKyAgIENPTkRfQkI6CisgICBpZiAo Y29uZCkgZ290byBNSURETEVfQkIxOyBlbHNlIGdvdG8gSk9JTl9CQiAoZWRn ZSBFMSkKKyAgIE1JRERMRV9CQjE6CisgICBzb21ldGhpbmcKKyAgIGZhbGx0 aHJvdWdoIChlZGdlIEUwKQorICAgSk9JTl9CQjoKKyAgIHNvbWUgbW9yZQor CisgICBvcgorCisgICAgQ09ORF9CQjoKKyAgIGlmIChjb25kKSBnb3RvIE1J RERMRV9CQjEoZWRnZSBFMCk7IGVsc2UgZ290byBNSURETEVfQkIyIChlZGdl IEUxKQorICAgTUlERExFX0JCMToKKyAgIHNvbWV0aGluZyAoaW5jbHVkaW5n IGxvYWQpCisgICBnb3RvIEpPSU5fQkIKKyAgIE1JRERMRV9CQjI6CisgICBz b21ldGhpbmcKKyAgIGZhbGx0aHJvdWdoIAorICAgSk9JTl9CQjoKKyAgIHNv bWUgbW9yZQorCisgICBvcgorCisgICAgQ09ORF9CQjoKKyAgIGlmIChjb25k KSBnb3RvIE1JRERMRV9CQjIgKGVkZ2UgRTEpOyBlbHNlIGdvdG8gTUlERExF X0JCMSAoZWRnZSBFMCkKKyAgIE1JRERMRV9CQjE6CisgICBzb21ldGhpbmcg KGluY2x1ZGluZyBsb2FkKQorICAgZ290by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