[llvm] [SPIR-V] Support optimization of branching with analyzeBranch/removeBranch/insertBranch functions (PR #110653)

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 3 05:33:16 PDT 2024


Keenuts wrote:

> @Keenuts Thank you for a good advice to be careful with analyzeBranch(). Testing and codegen source code helps to realize that the only safe option is to disable analyzeBranch(). One possible alternative to this would be to just entirely remove it from SPIRVInstrInfo, relying on default implementation. However, it seems better to keep it explicitly implemented with the comment as a way to document reasons to don't play with it in future. Please have a look at the result.

Thanks! I'm still dealing with structurizer bugs right now (found the reason for bad block sorting, and but fixing it triggers additional bugs). Sorry I hadn't had time to provide an example, but I'll bring some in the upcoming PR (simpler cases to showcase those things).

I think for the time being, not modifying branches after structuring might be for the best.
Thanks!

https://github.com/llvm/llvm-project/pull/110653


More information about the llvm-commits mailing list