[llvm] [GlobalIsel] combine extract vector element (PR #91922)

Amara Emerson via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 10:57:10 PDT 2024


Thorsten =?utf-8?q?Schütt?= <schuett at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/91922 at github.com>


aemerson wrote:

I think the key here is that combines have cost, in both compile time (every failed match is a time wasted) and in maintenance cost.

Using clang as the archetypal user of LLVM and assuming that other front-ends build similar pass manager pipelines, we should see if a piece of IR after optimizations still has room for improvement during codegen. Sometimes this is due to the fact that some combines only become visible to the optimizer after certain transformations, so they're phase-ordering sensitive. That's fine IMO. Likewise if certain transforms need more target specific information that we gain during codegen (perhaps because legalization makes some costs clearer or expands MIR and thus exposes more opportunity).

But I think a combine that never fires because in an exceedingly vast majority of cases the pattern is always optimized away at the IR level doesn't justify its existence. That said, these should only be guidelines IMO and we don't have to be dogmatic about it.

I agree that documentation would be useful here.

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


More information about the llvm-commits mailing list