Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cpl:labs:09 [2016/12/06 09:34]
bogdan.nitulescu [Ex. 4 - LLVM pass (6p)]
cpl:labs:09 [2016/12/06 23:02] (current)
bogdan.nitulescu [Ex.3 - Loops (3p)]
Line 358: Line 358:
 ==== Ex.3 - Loops (3p) ==== ==== Ex.3 - Loops (3p) ====
 Intrati in folder-ul ex.2 din arhiva de laborator. Compilati in cele 2 forme LLVM IR fisierul loops.c. Intrati in folder-ul ex.2 din arhiva de laborator. Compilati in cele 2 forme LLVM IR fisierul loops.c.
-Faceti urmatoarele optimizari: mem2reg, simplifycfg,​ loops, loop-simplify, loop-rotate,​ loop-unroll.+Faceti urmatoarele optimizari: mem2reg, simplifycfg,​ loops, loop-rotate,​ loop-unroll.
 Observati modificarile. Observati modificarile.
 ==== Ex. 4 - LLVM pass (6p) ==== ==== Ex. 4 - LLVM pass (6p) ====
Line 371: Line 371:
  
  
-Cel mai simplu mod pentru a crea pass-ul este sa copiati folderul hello din \$PathToLLVMSrc/​lib/​Transforms/​Hello in \$PathTooLLVMSrc/​lib/​Transforms/​\$MyPassName.+Cel mai simplu mod pentru a crea pass-ul este sa copiati folderul hello din \$PathToLLVMSrc/​lib/​Transforms/​Hello in \$PathTooLLVMSrc/​lib/​Transforms/​\$MyPass.
  
 <​code>​ <​code>​
-$PathToMyPassSrc/​CMakeLists.txt +$PathToLLVMSrc/​lib/​Transforms/​$MyPass/​CMakeLists.txt 
-$PathToMyPassSrc/Makefile+$PathToLLVMSrc/​lib/​Transforms/​$MyPass/Makefile 
 +$PathToLLVMSrc/​lib/​Transforms/​CMakeLists.txt
 </​code>​ </​code>​
 +
 +Redenumiti \$PathToLLVMSrc/​lib/​Transforms/​\$MyPass/​Hello.exports in \$PathToLLVMSrc/​lib/​Transforms/​\$MyPass/​\$MyPass.exports
 +
 +
 +Mergeti in folderul de build. Pe calculatoarele din laborator este ~/​cpl/​build. Rulati
 +<​code>​
 +cmake $PathToLLVMSrc
 +</​code>​
 +Pentru calculatoarele din laborator acesta este
 +<​code>​
 +cmake ../​llvm-3.8.0.src
 +</​code>​
 +
 +Apoi rulati make in folderul nou create din ~/​cpl/​build/​lib/​Transforms/​$MyPass.
 +
 +Trebuie sa rerulati cmake si make pentru fiecare modificare pe care o faceti in sursa pass-ului vostru.
 +Pass-ul compilat sub forma de biblioteca dinamica se va gasi in ~/​cpl/​build/​lib.
 +
  
 Hints: Hints:
cpl/labs/09.1481009645.txt.gz · Last modified: 2016/12/06 09:34 by bogdan.nitulescu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0