kth.sePublications
Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
A comparison of auto-vectorization performance between GCC and LLVM for the RISC-V vector extension
KTH, School of Electrical Engineering and Computer Science (EECS).
2024 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesisAlternative title
En jämförelse av autovektoriseringsprestenda mellan GCC och LLVM för RISC-V:s vektortillägg (Swedish)
Abstract [en]

Modern CPUs implement Single instruction multiple data (SIMD), which enables doing computations of several elements in one step. The variants in RISC-V and ARM SVE2 are vector length agnostic, meaning a new instruction set does not need to be developed to take advantage of wider SIMD units. This study explores how recent compilers perform automatic vectorization for the RISC-V vector extension. To further evaluate, a few tests of the TSVC 2 suite were selected and analyzed closer with the gem5 simulator and static analysis. One finding was that LLVM 17 used a specified application vector length more often than GCC 14, meaning it does not automatically scale to wider vector units. The results of this were different depending on when comparing the number of executed instructions or the number of simulated cycles, the former showing advantage for LLVM and the latter for GCC. The study also found that when the generated assembler was vector length agnostic, LLVM may perform better in medium vector register lengths when regarding both the number of instructions executed and the number of simulated cycles. Though the difference lessens when the vector register length increases.

Abstract [sv]

Moderna processorer implementerar SIMD-instruktioner (en instrukion, multipla data), gör det möjligt att hantera flera element i samma steg. Båden vektortillägget för RISC-V och ARM SVE2 har obestämd storlek på vektorregistrena, vilket betyder att en ny instruktionsuppsättning inte behöver utvecklas för att dra nytta av bredare SIMD-enheter. Den här studien utforskar hur nutida kompilatorer använder autovektorisering för RISC-V:s vektortillägg. För att utvärdera närmare valdes några test ur TSVC 2-sviten ut och analyserades med gem5-simulatorn och statisk analys. En upptäckt var att LLVM 17 använde en specificerad applikationsvektorlängd mer ofta än GCC 14, vilket betyder att den inte automatiskt skalar till bredare vektorenheter. Resultaten av detta varierade beroende på om antalet instruktioner eller antalet simularede klockcyckler jämfördes, det tidigare med ett övertag för LLVM men det senare för GCC. Studien upptäckte också att när den generede assemblern hade obestämd vektorlängd, kan LLVM prestera bättre i både antalet instruktioner och simulerade klockcycler med vektorer av medelstorlek. Dock minskar skillnaden mellan GCC och LLVM när vektorregistrens längd ökas.

Place, publisher, year, edition, pages
2024. , p. 79
Series
TRITA-EECS-EX ; 2024:337
National Category
Computer and Information Sciences
Identifiers
URN: urn:nbn:se:kth:diva-354873OAI: oai:DiVA.org:kth-354873DiVA, id: diva2:1905944
Supervisors
Examiners
Available from: 2024-10-24 Created: 2024-10-16 Last updated: 2024-10-24Bibliographically approved

Open Access in DiVA

fulltext(620 kB)478 downloads
File information
File name FULLTEXT01.pdfFile size 620 kBChecksum SHA-512
7b163ee7e3e8743780fa3f77ff1aca10b02374ed66ee0e79fb80b004cf41f8de82bc16e3a7e98b70310188c141e41ebde1889b77fc948946aeb20b7d684cc681
Type fulltextMimetype application/pdf

By organisation
School of Electrical Engineering and Computer Science (EECS)
Computer and Information Sciences

Search outside of DiVA

GoogleGoogle Scholar
Total: 478 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 640 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf