[PATCH] D12887: [Machine Combiner] Refactor machine reassociation into a target-independent pass

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 08:12:45 PDT 2015


spatel added a comment.

In http://reviews.llvm.org/D12887#247071, @haicheng wrote:

> 1. The machine-combiner pass searches and combines a pair of instructions (mul & add/sub), but the reassociation pass may optimize on a long chain of instructions.  They may need different optimizations in the future (e.g. compilation time optimization).
> 2. If a target needs to run both passes, it may need different pattern enums.  It might be ugly to put them in the same pass.


Both of these are hypothetical problems that don't exist today. If these problems arise in practice, then certainly we could create a new pass to deal with them, but that should be a separate step IMO.

For this patch, I think we should just be refactoring the reassociation functions to live in MachineCombiner. That way, we eliminate the duplicated code from the x86 + PPC backends without duplicating all of the code that's already in MachineCombiner.


Repository:
  rL LLVM

http://reviews.llvm.org/D12887





More information about the llvm-commits mailing list