globals deleted by "remove comments" when viewing LLVM IR via -emit-llvm
See original GitHub issueI often use compiler explorer with a -emit-llvm
flag to view the LLVM IR produced by Clang / LLVM’s middle-end optimizers. This generally works pretty well (and even syntax-highlights fairly nicely), but the “remove comments” option strips out lines starting with an @
, which deletes all the global variables!
Some better support for viewing LLVM IR output would be great (per #288), but if that’s a long way off, something as simple as detecting -emit-llvm
in the command line and not treating lines starting with @
as comments would be marvelous.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
globals deleted by "remove comments" when viewing LLVM ...
I often use compiler explorer with a -emit-llvm flag to view the LLVM IR produced by Clang / LLVM's middle-end optimizers.
Read more >Global Dead Code Elimination for LLVM, revisited
Global Dead Code Elimination is an LLVM pass that removes unused global symbols, like a static function that got inlined and now does...
Read more >⚙ D108872 [IR] Refactor GlobalIFunc to inherit from ... - LLVM
GlobalObject, and removes GlobalIndirectSymbol (while inlining the relevant parts into GlobalAlias and GlobalIFunc). This allows for
Read more >⚙ D63932 [GlobalDCE] Dead Virtual Function Elimination
This patch allows unused virtual functions to be removed during LTO (and regular compilation in limited circumstances) by using type ...
Read more >Clang Compiler User's Manual
This document describes important notes about using Clang as a compiler for an end-user, documenting the supported features, command line options, etc. If...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi - I’ve now improved how we detect when the compiler is asked to emit the IR and we properly filter it now. Sorry that this got forgotten. The fix should hit the live site shortly 😃
This change is now live. Thanks for the reminder @nickdesaulniers and thanks @RabsRincon for fixing it!