epiqc / ScaffCC

Compilation, analysis and optimization framework for the Scaffold quantum programming language.
BSD 2-Clause "Simplified" License
188 stars 53 forks source link

[PASS] FlattenModule generated 6837+K sha1.n12812.inlined.ll #15

Open xiangzhai opened 6 years ago

xiangzhai commented 6 years ago

Hi ScaffCC developers,

based on LLVM release_31 before the commit https://github.com/epiqc/ScaffCC/commit/871865b5409d163c0a8f95e206d845b889c8f72a

$ ./scaffold.sh -fkR Algorithms/SHA-1/sha1.n128.scaffold
[Scaffold.makefile] Transforming cbits ...
[Scaffold.makefile] O1 optimizations ...
[Scaffold.makefile] Unrolling Loops (1) ...
[Scaffold.makefile] Cloning Functions (1) ...
Functions Cloned: 0
[Scaffold.makefile] Dead Argument Elimination (1) ...
[Scaffold.makefile] Unrolling Loops (2) ...
[Scaffold.makefile] Cloning Functions (2) ...
Functions Cloned: 0
[Scaffold.makefile] Dead Argument Elimination (2) ...
[Scaffold.makefile] Internalizing and Removing Unused Functions ...
[Scaffold.makefile] Compiling RKQC Functions ...
[Scaffold.makefile] Toffoli Decomposition ...
[Scaffold.makefile] Inserting Reverse Functions...
[Scaffold.makefile] Flattening modules ...  <-- CPU 100%

Before FlattenModule PASS, sha1.n12812.ll is 222+K, but after FlattenModule, sha1.n12812.inlined.ll is 6837+K! then gen-gasm failed to transform such HUGE LLVM IR.

@eddieschoute Please try @ajavadia latest commit https://github.com/epiqc/ScaffCC/commit/871865b5409d163c0a8f95e206d845b889c8f72a it might be able to work for SHA-1 algorithm https://github.com/epiqc/ScaffCC/issues/7#issuecomment-348235689

Regards, Leslie Zhai