Let LLVMOpLowering specify a PatternBenefit - NFC

Currently the benefit is always set to 1 which limits the ability to do A->B->C lowering

PiperOrigin-RevId: 264854146
This commit is contained in:
Nicolas Vasilache 2019-08-22 09:38:16 -07:00 committed by A. Unique TensorFlower
parent 38d4e0b6a1
commit fa592908af
2 changed files with 4 additions and 4 deletions

View File

@ -116,7 +116,7 @@ private:
class LLVMOpLowering : public ConversionPattern {
public:
LLVMOpLowering(StringRef rootOpName, MLIRContext *context,
LLVMTypeConverter &lowering);
LLVMTypeConverter &lowering, PatternBenefit benefit = 1);
protected:
// Back-reference to the lowering class, used to call type and function

View File

@ -193,9 +193,9 @@ static Type getMemRefElementPtrType(MemRefType t, LLVMTypeConverter &lowering) {
}
LLVMOpLowering::LLVMOpLowering(StringRef rootOpName, MLIRContext *context,
LLVMTypeConverter &lowering_)
: ConversionPattern(rootOpName, /*benefit=*/1, context),
lowering(lowering_) {}
LLVMTypeConverter &lowering_,
PatternBenefit benefit)
: ConversionPattern(rootOpName, benefit, context), lowering(lowering_) {}
namespace {
// Base class for Standard to LLVM IR op conversions. Matches the Op type