Skip to content

Commit

Permalink
Merge Rahul's changes (#173)
Browse files Browse the repository at this point in the history
* Create optimization_ideas.Rmd (#156)

Creates optimization_ideas vignette

* DCE: examples and Idea section from GCI-2019

DCE: examples and Idea section from GCI-2019

* A PR combining the PRs of all Google Code-in students related to loop-invariate optimizer (#163)

thanks!

* GCI PR for constant folding optimizer (#164)

Co-authored-by: Stephanie <[email protected]>
Co-authored-by: Umang Majumder <[email protected]>
Co-authored-by: udaydatar7 <[email protected]>
Co-authored-by: Eric Liu <[email protected]>
Co-authored-by: Pratish <[email protected]>
Co-authored-by: Rahul Saxena <[email protected]>

* GCI PRs for opt-common-subexpr (#165)

thanks!

Co-authored-by: Adrian Serapio <[email protected]>
Co-authored-by: azamlynny <[email protected]>
Co-authored-by: Umang Majumder <[email protected]>
Co-authored-by: Jack-horwell <[email protected]>
Co-authored-by: Pratish <[email protected]>
Co-authored-by: udaydatar7 <[email protected]>
Co-authored-by: Juan Cruz Rodriguez <[email protected]>
Co-authored-by: Rahul Saxena <[email protected]>

* All GCI PRs for constant propagation optimizer (#166)

thanks!

Co-authored-by: Pratish <[email protected]>
Co-authored-by: udaydatar7 <[email protected]>
Co-authored-by: Umang Majumder <[email protected]>
Co-authored-by: Juan Cruz Rodriguez <[email protected]>
Co-authored-by: Rahul Saxena <[email protected]>

* All GCI PRs for dead expression optimizer. (#167)

thanks!

Co-authored-by: Adrian Serapio <[email protected]>
Co-authored-by: Umang Majumder <[email protected]>
Co-authored-by: Pratish <[email protected]>
Co-authored-by: Eric Liu <[email protected]>
Co-authored-by: Rahul Saxena <[email protected]>

* All GCI PRs for Dead Store Optimizer (#168)

thanks!

Co-authored-by: Umang Majumder <[email protected]>
Co-authored-by: Eric Liu <[email protected]>
Co-authored-by: Pratish <[email protected]>
Co-authored-by: Adrian Serapio <[email protected]>
Co-authored-by: Rishi R <[email protected]>
Co-authored-by: Rahul Saxena <[email protected]>
Co-authored-by: Juan Cruz Rodriguez <[email protected]>

* Conditional Thread Optimizer PR (#162)

* Explained Dead Code Elimination

* Update opt-dead-code.R

* Update opt-dead-code.R

* Create opt-dead-code-example.R

* Update opt-dead-code.R

* Added examples

Examples of unoptimized and optimized code to explain dead code elimination

* Added #' to example

* Non-technical description of dead code elimination

* Update to definition in ##Idea

GCI user ID Rishi0812

* Added example of Dead Code Elimination

* Added Idea Section to Dead Code Elimination Vignette

* Updating NEWS.md

* Changing \donttest for \dontrun, it seems 4.0.0 will check donttest examples.

* Rebuilding site.

* Removing renv.

* Removing a separate example file for DCE

This was introduced when I merged a PR from a student's fork of the `rco`.

* Finalizing the Idea section of the DCE

* Selected final examples for DCE

* Final example selected

* Resolved spacing issue

* Resolved Spacing Issue - 2

* Resolved Spacing Issue - 3

* Improved the Idea section

* Fixed the performance typo

* Revert "Fixed the performance typo"

This reverts commit c791bef.

* Update opt-dead-code.Rmd

typo fix

* Added a few functions

* Added a few functions

* Added logic for duplicate expr

* Meh

* Added merge logic

* The entire process of merging implemented. Phhew!!

* Ran into the else parse bug

* First iteration complete

* Final commit for cond_thread

* Meh

* Resolved duplicate vignette

* Solved another issue in vignette build

* I'm sleepy now, this is last

* Missed a comma :(

* I dunno what's happening anymore

* Fixed the >= function logic

* Last ditch

* Ok I'm officially crying now T_T

* Now no test would fail

* Seriously, this is the last time

* Bhak

* erfg

* Update parse.R

* Update opt-constant-folding.R

* Update opt-dead-code.R

* Dude c'mmon

* Update optimize-files.R

* Update opt-dead-code.R

* plixx

* Added more tests to increase coverage

* Another test for extra coverage

* Implemented suggested changes

* Some missing edits

* Improved Tests

* Fixed boolean condition

* Improved indentations

* documented

* Workaround for R CMD check failed

* Version bump & code styling

* Examples edit

* Fixed the indentation bug

* Code Styiling

* Provided another example in vignette

* Improving vignette

* Styling test cases

* Fixed unwanted changes due to `;`

* Ran all checks, works fine

Co-authored-by: Pratish <[email protected]>
Co-authored-by: Ian Chang <[email protected]>
Co-authored-by: Jack-horwell <[email protected]>
Co-authored-by: Rishi R <[email protected]>
Co-authored-by: Adrian Serapio <[email protected]>
Co-authored-by: Juan Cruz Rodriguez <[email protected]>
Co-authored-by: Rahul Saxena <[email protected]>

* Adding the Memory Allocation Optimizer (#169)

* Initial Commit

* Second commit - firm logic in place

* First iteration of a working prototype

* Just another test text

* Tests and Vignettes for mem-alloc opt

* Final edits in diff files for the new optimizer

* Removed unnecessary files

* Reverted changes in man/opt_dead

* Reverted changes in man/opt_dead

* Reverted changes in man/const_prop

* Reverted changes in man/common_subexpr

Co-authored-by: Rahul Saxena <[email protected]>
Co-authored-by: Juan C Rodriguez <[email protected]>

* Possible fix for Issue#107 (#170)

* Possible fix for issue#107

* Reverting unrelated changes

* Reverting unrelated changes

* Reverting unrelated changes

Co-authored-by: Rahul Saxena <[email protected]>

* Added the reporting functions (#171)

* Added the reporting functions

* Added comments

Co-authored-by: Rahul Saxena <[email protected]>

* Please add this doc in the Article section of the official rco website (#172)

* Please add this in the Article section of the official rco website

* Fixed some blockquote issues

* Trying new changes

* Delete Document.dcf

Co-authored-by: Rahul Saxena <[email protected]>
Co-authored-by: Juan C Rodriguez <[email protected]>

* Checking merge

Co-authored-by: Rahul Saxena <[email protected]>
Co-authored-by: Stephanie <[email protected]>
Co-authored-by: Umang Majumder <[email protected]>
Co-authored-by: udaydatar7 <[email protected]>
Co-authored-by: Eric Liu <[email protected]>
Co-authored-by: Pratish <[email protected]>
Co-authored-by: Rahul Saxena <[email protected]>
Co-authored-by: Adrian Serapio <[email protected]>
Co-authored-by: azamlynny <[email protected]>
Co-authored-by: Jack-horwell <[email protected]>
Co-authored-by: Rishi R <[email protected]>
Co-authored-by: Ian Chang <[email protected]>
  • Loading branch information
13 people authored Jul 14, 2021
1 parent bf16596 commit 9f8ff5e
Show file tree
Hide file tree
Showing 137 changed files with 7,113 additions and 644 deletions.
5 changes: 5 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# Generated by roxygen2: do not edit by hand

export(all_optimizers)
export(generate_files_opt_report)
export(generate_folder_opt_report)
export(generate_text_opt_report)
export(max_optimizers)
export(opt_common_subexpr)
export(opt_cond_thread)
export(opt_constant_folding)
export(opt_constant_propagation)
export(opt_dead_code)
export(opt_dead_expr)
export(opt_dead_store)
export(opt_loop_invariant)
export(opt_memory_alloc)
export(optimize_files)
export(optimize_folder)
export(optimize_text)
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# rco 1.0.2

- Adding Memory Allocation optimizer.
- Adding Conditional Threading optimizer.

# rco 1.0.1

- Bug fixing.
Expand Down
8 changes: 8 additions & 0 deletions R/opt-common-subexpr.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
#' sep = "\n"
#' )
#' cat(opt_common_subexpr(list(code))$codes[[1]])
#'
#' heron_formula <- paste(
#' "area <- (a/2 + b/2 +c/2) * (a/2 + b/2 + c/2 - a) * (a/2 + b/2 + c/2 - b) *",
#' " (a/2 + b/2 + c/2 - c)",
#' "area <- sqrt(area)",
#' sep = '\n'
#' )
#' cat(opt_common_subexpr(list(heron_formula))$codes[[1]])
#' @export
#'
opt_common_subexpr <- function(texts, n_values = 2, in_fun_call = FALSE) {
Expand Down
Loading

0 comments on commit 9f8ff5e

Please sign in to comment.