Σχεδίαση και Υλοποίηση ενός Optimization Pass στο LLVM για την Αναγνώριση Ιδιωμάτων Κώδικα
| dc.contributor.advisor | Βασιλάκης, Κωνσταντίνος | |
| dc.contributor.advisor | Δημητρουλάκος, Γρηγόριος | |
| dc.contributor.author | Μότση, Πολυξένη | |
| dc.contributor.committee | Τσελίκας, Νικόλαος | |
| dc.contributor.department | Τμήμα Πληροφορικής και Τηλεπικοινωνιών | el |
| dc.contributor.faculty | Σχολή Οικονομίας και Τεχνολογίας | el |
| dc.contributor.master | Επιστήμη Υπολογιστών | el |
| dc.date.accessioned | 2026-04-03T09:27:30Z | |
| dc.date.available | 2026-04-03T09:27:30Z | |
| dc.date.issued | 2026-03-13 | |
| dc.description | Μ.Δ.Ε. 114 | el |
| dc.description.abstract | Η σύγχρονη μεταγλώττιση βασίζεται στην ικανότητα των μεταγλωττιστών να μετασχηματίζουν κώδικα υψηλού επιπέδου σε αποδοτικές εντολές μηχανής. Ωστόσο, κατά τη διαδικασία μετάφρασης στην Ενδιάμεση Αναπαράσταση (Intermediate Representation - IR), η αρχική πρόθεση του προγραμματιστή συχνά συσκοτίζεται, οδηγώντας σε αυτό που ονομάζεται «Σημασιολογικό Χάσμα» (Semantic Gap). Πολύπλοκα μαθηματικά ιδιώματα υποβιβάζονται σε φλύαρες ακολουθίες γενικών εντολών, εμποδίζοντας την αξιοποίηση εξειδικευμένου υλικού. Η παρούσα διπλωματική εργασία αντιμετωπίζει αυτό το πρόβλημα μέσω της σχεδίασης και υλοποίησης του PatternSelectPass, ενός περάσματος βελτιστοποίησης (Optimization Pass) ενταγμένου στον Νέο Διαχειριστή Περασμάτων (New Pass Manager) του LLVM. Το προτεινόμενο εργαλείο χρησιμοποιεί προηγμένες τεχνικές ταύτισης προτύπων (pattern matching) για τον εντοπισμό επτά (7) κρίσιμων αριθμητικών ιδιωμάτων, συμπεριλαμβανομένων της Περιστροφής Bit (Rotate), της Καταμέτρησης Πληθυσμού (PopCount), της Ακέραιας Απόλυτης Τιμής (Abs) και των πράξεων Ελαχίστου/Μεγίστου (Min/Max). Μόλις αναγνωριστούν, αυτές οι ακολουθίες αντικαθίστανται αυτόματα από τις αντίστοιχες Εγγενείς Συναρτήσεις (Intrinsics) του LLVM. Η πειραματική αξιολόγηση σε στοχευμένα σενάρια ελέγχου κατέδειξε ότι το PatternSelectPass επιτυγχάνει μείωση του στατικού αριθμού εντολών κατά 52.9% σε σύγκριση με τον μη βελτιστοποιημένο κώδικα, ξεπερνώντας σε συγκεκριμένες περιπτώσεις ακόμη και τον καθιερωμένο βελτιστοποιητή InstCombine. Επιπλέον, η χρήση intrinsics οδηγεί σε σημαντική απλοποίηση του Γράφου Ροής Ελέγχου (Control Flow Graph), εξαλείφοντας περιττές διακλαδώσεις και προετοιμάζοντας το έδαφος για βέλτιστη παραγωγή κώδικα στο backend. | el |
| dc.description.abstracttranslated | Modern compilation relies on the ability of compilers to transform high-level code into efficient machine instructions. However, during the translation process to Intermediate Representation (IR), the programmer’s original intent is often obscured, leading to what is known as the "Semantic Gap". Complex mathematical idioms are lowered into verbose sequences of generic instructions, hindering the utilization of specialized hardware capabilities. This thesis addresses this problem through the design and implementation of PatternSelectPass, an optimization pass integrated into LLVM’s New Pass Manager. The proposed tool utilizes advanced pattern matching techniques to detect seven (7) critical arithmetic idioms, including Bitwise Rotate, Population Count, Integer Absolute Value, and Min/Max operations. Once recognized, these sequences are automatically replaced by the corresponding LLVM Intrinsics. Experimental evaluation on targeted test scenarios demonstrated that Pattern Select Pass achieves a 52.9% reduction in static instruction count compared to unoptimized code, outperforming in specific cases even the established InstCombine optimizer. Furthermore, the use of intrinsics leads to a significant simplification of the Control Flow Graph (CFG), eliminating unnecessary branches and paving the way for optimal code generation in the backend. | el |
| dc.format.extent | 81 | el |
| dc.identifier.uri | https://amitos.library.uop.gr/handle/123456789/9921 | |
| dc.language.iso | el | el |
| dc.publisher | Πανεπιστήμιο Πελοποννήσου | el |
| dc.rights | Αναφορά Δημιουργού-Μη Εμπορική Χρήση-Όχι Παράγωγα Έργα 3.0 Ελλάδα | * |
| dc.rights | Αναφορά Δημιουργού 3.0 Ελλάδα | * |
| dc.rights.uri | http://creativecommons.org/licenses/by/3.0/gr/ | * |
| dc.subject | Βελτιστοποίηση μεταγλωττιστών | el |
| dc.subject | Σημασιολογία | el |
| dc.subject | Μεταγλωττιστές (προγράμματα υπολογιστών) — Σχεδίαση | el |
| dc.subject | Optimizing compilers | el |
| dc.subject | Semantics | el |
| dc.subject | Compilers(Computer software)-Design | el |
| dc.subject.keyword | LLVM | el |
| dc.subject.keyword | Compiler | el |
| dc.subject.keyword | Pass | el |
| dc.subject.keyword | Optimization Pass | el |
| dc.title | Σχεδίαση και Υλοποίηση ενός Optimization Pass στο LLVM για την Αναγνώριση Ιδιωμάτων Κώδικα | el |
| dc.title.alternative | Design and Implementation of an LLVM Optimization Pass for Code Idiom Recognition | el |
| dc.type | Μεταπτυχιακή διπλωματική εργασία | el |
Files
Original bundle
1 - 1 of 1
Loading...
- Name:
- Polyxeni Motsi - Design and Implementation of an LLVM Optimization Pass for Code Idiom Recognition.pdf
- Size:
- 2.05 MB
- Format:
- Adobe Portable Document Format
- Description:
License bundle
1 - 1 of 1
Loading...
- Name:
- license.txt
- Size:
- 933 B
- Format:
- Item-specific license agreed upon to submission
- Description:
