I need to compiler some Haskell source code with GHC -O1 optimization but with the constant folding optimization disabled. I could not find an optimization flag for toggling constant folding in GHC manual however. Is this possible to turn off it meanwhile keep other optimizations?
Is there a way to disable the constant folding optimization in GHC?
571 views Asked by hooray9 At
1
There are 1 answers
Related Questions in HASKELL
- Typeclass projections as inheritance
- How to generate all possible matrices given a number n in Haskell
- Is there a way to get `cabal` to detect changes to non-Haskell source files?
- How to have fixed options using Option.Applicative in haskell?
- How can I create a thread in Haskell that will restart if it gets killed due to any reason?
- Automatic Jacobian matrix in Haskell
- Haskell writing to named pipe unexpectedly fails with `openFile: does not exist (No such device or address)`
- Why does Enum require to implement toEnum and fromEnum, if that's not enough for types larger than Int?
- Non-exhaustive patterns in function compress
- How to get terms names of GADT in Template Haskell?
- Implementing eval() function with Happy parser generator
- How to count the occurences of every element in a list in Haskell fast?
- In Haskell, what does `Con Int` mean?
- Extract a Maybe from a heterogeneous collection
- Haskell, Stack, importing module shows error "Module not found"
Related Questions in OPTIMIZATION
- Optimize LCP ReactJs
- Efficiently processing many small elements of a collection concurrently in Java
- How to convert the size of the HTML document from 68 Kb to the average of 33 Kb?
- Optimizing Memory-Bound Loop with Indirect Prefetching
- Google or-tools soft constraint issue
- How to find function G(x), and make for every x, G(x) always returns fixed point for another function F(G(x))
- Trying to sort a set of words with the information theory to solve Worlde in Python but my program is way to slow
- Do conditional checks cause bottlenecks in Javascript?
- Hourly and annual optimization problem over matrix
- Sending asynchronous requests without a pre-defined task list
- DBT - Using SELECT * in the staging layer
- Using `static` on a AVX2 counter function increases performance ~10x in MT environment without any change in Compiler optimizations
- Is this a GCC optimiser bug or a feature?
- Performance difference between two JavaScript code snippets for comparing arrays of strings
- Distribute a list of positive numbers into a desired number of sets, aiming to have sums as close as possible between them
Related Questions in COMPILATION
- I am trying to run java application in Eclipse, When I try to do Run > Run as > Java Application it starts to show little processing but nothing happe
- Unable to run get .exe file from assembly NASM
- Javascript to Java
- How to compile only the changed files in Verilator?
- Why does the .exe file become locked after compiling?
- Installing the C compiler for LC3
- compile syzkaller fuzzer failed without any error or warning
- Solved: Create standalone executable for MacOS with OpenCV and libmagic
- How to work around the "collect2: error: ld returned 1 exit status" error when running simple fortran files with the gfortran command?
- how to add a compiler type supported for sccache?
- Vulkan ‘VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR’ was not declared in this scope
- Rust newbie compile error (for (key: String, value: String) in | ^ expected one of `)`, `,`, `@`, or `|`)
- latest version of redshift with crazy compile times
- Problem compiling out-dated Typescript code
- What is appropriate substitution for configurations.compile in newer gradle e.g. version 8.7?
Related Questions in GHC
- How to use GHC’s `ReadPrec`?
- Homebrew error when installing GHC: linker does not have option `-no_fixup_chains`
- Why does Cabal, unlike GHC, not automatically enable GeneralizedNewtypeDeriving if I explicitly enabled DerivingStrategies?
- Understanding and Optimizing Generational Garbage Collection in Haskell
- Run cleanup function in multiple Haskell child threads when POSIX Signal sent (SIGTERM etc)
- libffi.so link issue for Haskell compiled executable on Linux platforms
- Admissble type role overrides
- How to change the order of type application parameters for a constructor
- Why does Data.Dynamic contain a witness instead of a typeclass constraint?
- cabal link error undefined symbol on windows
- Haskell speed issue where executing both parts of a program takes significantly longer than either part alone
- Haskell's polymorphic functions in different GHC version
- Haskell - Cabal linker command failed when installing Text.Regex.Posix
- Working around conflict between `c-source` name and GHC RTS name
- GHC API equivalent of adding a C/C++ file/object to the compilation
Related Questions in CONSTANTFOLDING
- For what purpose does GCC create separate bitmasks applied to shifted items?
- What is the expected behavior of C++ constant folding of integer expressions?
- How can I disable constant folding in Perl?
- Is the difference between these two evals explained with constant folding?
- Disable constant folding for LLVM 10 C++ API
- Where is the description of Constant Folding in the Java Language Specification, Java SE 11 Edition (JLS SE 11)?
- Deserialize JSON Map in a constant-foldable way C#
- What are the specific rules for constant folding?
- Is there a way to fold an initializer list in C++17
- Preprocessor constant folding
- Compiler Does No Constant Folding for Masking Class
- C++ constant folding a loop for prime numbers
- does golang compiler use constant folding?
- Compile python source without constant folding optimization
- Overflow during constant folding on a 16-bit target architecture
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
If you compile with
-fno-enable-rewrite-rules, it disables constant folding. Also, IMO if you pass the constants to a NOINLINE function and use them inside the function, you stand a good chance that it doesn't get folded.