5 ms·
Are there linters that will overlay compiler-tier optimization hints on top of handwritten assembly?
by _bxg1 7y ago
Are there linters that will overlay compiler-tier optimization hints on top of handwritten assembly?
- sesuximo 7y agoThis would be cool. I usually write up some C snippets and compare what different compilers do with what I have. The compiler explorer makes this really easy
- monocasa 7y agoHuh, yeah, that'd be neat. Specifically just ripping out the peephole optimizer from a backend just for matching would be a great start with a decent amount of value and not a god tier amount of work. That being said, you're not going to see the really crazy optimizations that compilers can do, because they need a bit of a higher level view of what you're trying to do.
- emidln 7y agoYou could try to use one of the c language reversers to get c source code and then ask gcc/clang.
- pandaman 7y agoDon't know of anything that works on the source code level but static analysis in profilers does that for the object code (ones I use are proprietary but I imagine something like V-Tune does this as well).
- CalChris 7y agoThe closest thing would be the Godbolt Compiler Explorer: https://godbolt.org/ https://godbolt.org/
- pjmlp 7y agoIt is nice tool for online exploration, but not as V-Tune.
- dbcurtis 7y agoI have not looked at it in many years, but Intel's VTune tool was designed to help coders analyze and hand-tune code.
- lizardmancan 7y agothat would be neat for any language. A way to see what actually happens.
- 5- 7y agonot precisely what you're asking, but there are two tools that annotate machine instructions with results from throughput and latency analysis, which helps with loop microoptimisation. the original from intel, iaca: https://software.intel.com/en-us/articles/intel-architecture-code-analyzer https://software.intel.com/en-us/articles/intel-architecture... newer clone, shipped with llvm: https://llvm.org/docs/CommandGuide/llvm-mca.html https://llvm.org/docs/CommandGuide/llvm-mca.html