TreeSeq: Register Pressure Aware Instruction Selection and Scheduling Based on Tree Pattern Matching

preprint OA: closed CC-BY-4.0
📄 Open PDF Full text JSON View at publisher

Abstract

Abstract As the gap between CPU and memory speeds continues to widen, optimizing register usage in high performance processors becomes increasingly important. While many exact algorithms and heuristic techniques have been proposed to reduce register pressure via instruction scheduling, there are two critical challenges. Challenge-1: these approaches often struggle to balance the quality of generated code with compilation time. Challenge-2: their scheduling decisions may detrimentally affect instruction selection outcomes. In this paper, we propose a multi-phase integrated method of instruction selection and scheduling based on tree pattern matching called TreeSeq, which aims to reduce register pressure. TreeSeq first converts the intermediate representation into a set of as large expression trees as possible. It then reduces register pressure through two phases: Sethi-Ullman algorithm-based expression tree node ordering and heuristic expression tree scheduling. Finally, it applies tree pattern matching to these expression trees. TreeSeq ensures the quality of the generated code while reducing compilation time by splitting the classical instruction scheduling into two phases. It also generates more optimized code and further improves compilation time by integrating instruction scheduling into instruction selection. Our evaluation shows that TreeSeq achieves up to a 1.37x speedup on the SysY2022 benchmark. It reduces register pressure comparably to exact methods while saving an average of 57.19% in compilation time. Moreover, TreeSeq generates more optimized code than decoupled approaches of doing instruction selection and scheduling in two separate phases, with 34.32% average time savings.
Full text 16,303 characters · extracted from preprint-html · click to expand
TreeSeq: Register Pressure Aware Instruction Selection and Scheduling Based on Tree Pattern Matching | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article TreeSeq: Register Pressure Aware Instruction Selection and Scheduling Based on Tree Pattern Matching Tongchao Miao, Xingjun Zhang This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-8250174/v1 This work is licensed under a CC BY 4.0 License Status: Under Review Version 1 posted 25 You are reading this latest preprint version Abstract As the gap between CPU and memory speeds continues to widen, optimizing register usage in high performance processors becomes increasingly important. While many exact algorithms and heuristic techniques have been proposed to reduce register pressure via instruction scheduling, there are two critical challenges. Challenge-1: these approaches often struggle to balance the quality of generated code with compilation time. Challenge-2: their scheduling decisions may detrimentally affect instruction selection outcomes. In this paper, we propose a multi-phase integrated method of instruction selection and scheduling based on tree pattern matching called TreeSeq, which aims to reduce register pressure. TreeSeq first converts the intermediate representation into a set of as large expression trees as possible. It then reduces register pressure through two phases: Sethi-Ullman algorithm-based expression tree node ordering and heuristic expression tree scheduling. Finally, it applies tree pattern matching to these expression trees. TreeSeq ensures the quality of the generated code while reducing compilation time by splitting the classical instruction scheduling into two phases. It also generates more optimized code and further improves compilation time by integrating instruction scheduling into instruction selection. Our evaluation shows that TreeSeq achieves up to a 1.37x speedup on the SysY2022 benchmark. It reduces register pressure comparably to exact methods while saving an average of 57.19% in compilation time. Moreover, TreeSeq generates more optimized code than decoupled approaches of doing instruction selection and scheduling in two separate phases, with 34.32% average time savings. Register Pressure Reduction Instruction Selection Tree Pattern Matching Instruction Scheduling Sethi-Ullman Algorithm Full Text Additional Declarations No competing interests reported. Cite Share Download PDF Status: Under Review Version 1 posted Reviews received at journal 12 May, 2026 Reviews received at journal 09 May, 2026 Reviews received at journal 07 May, 2026 Reviews received at journal 06 May, 2026 Reviews received at journal 06 May, 2026 Reviews received at journal 06 May, 2026 Reviews received at journal 05 May, 2026 Reviews received at journal 04 May, 2026 Reviews received at journal 01 May, 2026 Reviews received at journal 21 Apr, 2026 Reviewers agreed at journal 14 Apr, 2026 Reviewers agreed at journal 10 Apr, 2026 Reviewers agreed at journal 10 Apr, 2026 Reviewers agreed at journal 10 Apr, 2026 Reviewers agreed at journal 09 Apr, 2026 Reviewers agreed at journal 08 Apr, 2026 Reviewers agreed at journal 08 Apr, 2026 Reviewers agreed at journal 08 Apr, 2026 Reviewers agreed at journal 08 Apr, 2026 Reviewers agreed at journal 08 Apr, 2026 Reviewers agreed at journal 08 Apr, 2026 Reviewers invited by journal 08 Apr, 2026 Editor assigned by journal 06 Apr, 2026 Submission checks completed at journal 03 Dec, 2025 First submitted to journal 01 Dec, 2025 You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-8250174","acceptedTermsAndConditions":true,"allowDirectSubmit":false,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":622829043,"identity":"60bee6fc-2286-48fc-8abe-d57257e7325c","order_by":0,"name":"Tongchao Miao","email":"","orcid":"","institution":"Xi'an Jiaotong University","correspondingAuthor":false,"prefix":"","firstName":"Tongchao","middleName":"","lastName":"Miao","suffix":""},{"id":622829044,"identity":"9b63e03f-1183-42de-8529-646c8ddb8e5a","order_by":1,"name":"Xingjun Zhang","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA3UlEQVRIie2RrQ7CMBSFLyHZzJbZLgvwCltmSPYym6oBNAKWq+rING+BRHZZ0pkR7CQYHAkWAWE/oEhKJaKfOD3ifuKkABrNX8KNNsdNad+huhICFMoKdEqC/bWC4ufl5XTfr+kuPwoCyyhB88ClioucBpuqnG+xMAhUNEFrEUsVB7ggNhPzDBplwIoEieX/GJIz98EENTrlqaA4zaVns1XsdAoqKC4KwxsxHjRbwmksaMismVzx6/LiXlk68ev8XN9W0SgzK7kChLdZ9CWG9zfJx2Cb6adoNBqN5psXHy5HqLs5Y2UAAAAASUVORK5CYII=","orcid":"","institution":"Xi'an Jiaotong University","correspondingAuthor":true,"prefix":"","firstName":"Xingjun","middleName":"","lastName":"Zhang","suffix":""}],"badges":[],"createdAt":"2025-12-01 12:08:26","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-8250174/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-8250174/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":106935058,"identity":"b6e8adc5-4f6c-4c5d-83d4-c10485920684","added_by":"auto","created_at":"2026-04-15 03:09:57","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":375611,"visible":true,"origin":"","legend":"","description":"","filename":"snarticletemplate.pdf","url":"https://assets-eu.researchsquare.com/files/rs-8250174/v1_covered_9d292e08-9a90-46e5-8f4f-641ee82c98a1.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"TreeSeq: Register Pressure Aware Instruction Selection and Scheduling Based on Tree Pattern Matching","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":false,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"[email protected]","identity":"the-journal-of-supercomputing","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"","sideBox":"Learn more about [The Journal of Supercomputing](https://www.springer.com/journal/11227)","snPcode":"11227","submissionUrl":"https://submission.nature.com/new-submission/11227/3","title":"The Journal of Supercomputing","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"stoa","reportingPortfolio":"Springer Hybrid","inReviewEnabled":true,"inReviewRevisionsEnabled":false},"keywords":"Register Pressure Reduction, Instruction Selection, Tree Pattern Matching, Instruction Scheduling, Sethi-Ullman Algorithm","lastPublishedDoi":"10.21203/rs.3.rs-8250174/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-8250174/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eAs the gap between CPU and memory speeds continues to widen, optimizing register usage in high performance processors becomes increasingly important. While many exact algorithms and heuristic techniques have been proposed to reduce register pressure via instruction scheduling, there are two critical challenges. \u003cb\u003eChallenge-1:\u003c/b\u003e these approaches often struggle to balance the quality of generated code with compilation time. \u003cb\u003eChallenge-2:\u003c/b\u003e their scheduling decisions may detrimentally affect instruction selection outcomes. In this paper, we propose a multi-phase integrated method of instruction selection and scheduling based on tree pattern matching called TreeSeq, which aims to reduce register pressure. TreeSeq first converts the intermediate representation into a set of as large expression trees as possible. It then reduces register pressure through two phases: Sethi-Ullman algorithm-based expression tree node ordering and heuristic expression tree scheduling. Finally, it applies tree pattern matching to these expression trees. TreeSeq ensures the quality of the generated code while reducing compilation time by splitting the classical instruction scheduling into two phases. It also generates more optimized code and further improves compilation time by integrating instruction scheduling into instruction selection. Our evaluation shows that TreeSeq achieves up to a 1.37x speedup on the SysY2022 benchmark. It reduces register pressure comparably to exact methods while saving an average of 57.19% in compilation time. Moreover, TreeSeq generates more optimized code than decoupled approaches of doing instruction selection and scheduling in two separate phases, with 34.32% average time savings.\u003c/p\u003e","manuscriptTitle":"TreeSeq: Register Pressure Aware Instruction Selection and Scheduling Based on Tree Pattern Matching","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2026-04-15 03:08:16","doi":"10.21203/rs.3.rs-8250174/v1","editorialEvents":[{"type":"communityComments","content":0},{"type":"editorInvitedReview","content":"","date":"2026-05-12T13:45:18+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-09T14:27:57+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-07T10:35:46+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-07T00:41:32+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-06T17:10:40+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-06T15:53:57+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-05T10:01:37+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-05T01:52:30+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-01T10:24:05+00:00","index":"hide","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-04-21T08:46:40+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"318052069275688124684248494902760388242","date":"2026-04-14T08:42:50+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"339632597215288863787770867008548447920","date":"2026-04-10T21:31:20+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"245409080495607626627665638142293940871","date":"2026-04-10T10:43:52+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"326786509391596242443119471568720701919","date":"2026-04-10T06:04:21+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"166092227987911002054328730668411250951","date":"2026-04-09T21:17:29+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"271288019081722157123721539015746292203","date":"2026-04-09T01:21:28+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"75784232600457392861373908731727057684","date":"2026-04-08T19:00:34+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"244127208502242290580302100418223631591","date":"2026-04-08T14:00:36+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"236818729117411962736552859150723728161","date":"2026-04-08T06:22:17+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"133603864100391945556716330564064318516","date":"2026-04-08T06:15:25+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"275619949166305460364032031238693497751","date":"2026-04-08T05:54:29+00:00","index":"hide","fulltext":""},{"type":"reviewersInvited","content":"","date":"2026-04-08T05:20:40+00:00","index":"","fulltext":""},{"type":"editorAssigned","content":"","date":"2026-04-06T22:41:20+00:00","index":"","fulltext":""},{"type":"checksComplete","content":"","date":"2025-12-03T17:47:20+00:00","index":"","fulltext":""},{"type":"submitted","content":"The Journal of Supercomputing","date":"2025-12-01T12:02:08+00:00","index":"","fulltext":""}],"status":"published","journal":{"display":true,"email":"[email protected]","identity":"the-journal-of-supercomputing","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"","sideBox":"Learn more about [The Journal of Supercomputing](https://www.springer.com/journal/11227)","snPcode":"11227","submissionUrl":"https://submission.nature.com/new-submission/11227/3","title":"The Journal of Supercomputing","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"stoa","reportingPortfolio":"Springer Hybrid","inReviewEnabled":true,"inReviewRevisionsEnabled":false}}],"origin":"","ownerIdentity":"a8508d22-6b80-4793-8910-73b558bc3f97","owner":[],"postedDate":"April 15th, 2026","published":true,"recentEditorialEvents":[{"type":"editorInvitedReview","content":"","date":"2026-05-12T13:45:18+00:00","index":138,"fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-09T14:27:57+00:00","index":137,"fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-07T10:35:46+00:00","index":136,"fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-07T00:41:32+00:00","index":135,"fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-06T17:10:40+00:00","index":134,"fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-06T15:53:57+00:00","index":133,"fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-05T10:01:37+00:00","index":132,"fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-05T01:52:30+00:00","index":131,"fulltext":""},{"type":"editorInvitedReview","content":"","date":"2026-05-01T10:24:05+00:00","index":130,"fulltext":""}],"rejectedJournal":[],"revision":"","amendment":"","status":"under-review","subjectAreas":[],"tags":[],"updatedAt":"2026-04-15T03:08:17+00:00","versionOfRecord":[],"versionCreatedAt":"2026-04-15 03:08:16","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-8250174","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-8250174","identity":"rs-8250174","version":["v1"]},"buildId":"XKTyCvWXoU3ODBz1xrDgd","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2026) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00
unpaywall
last seen: 2026-05-20T11:00:21.680559+00:00
License: CC-BY-4.0