ΒΆllvm::SelectPatternResult matchSelectPattern(
    llvm::Value* V,
    llvm::Value*& LHS,
    llvm::Value*& RHS,
    Instruction::CastOps* CastOp = nullptr,
    unsigned int Depth = 0)

Description

Pattern match integer [SU]MIN, [SU]MAX and ABS idioms, returning the kind and providing the out parameter results if we successfully match. For ABS/NABS, LHS will be set to the input to the abs idiom. RHS will be the negation instruction from the idiom. If CastOp is not nullptr, also match MIN/MAX idioms where the type does not match that of the original select. If this is the case, the cast operation (one of Trunc,SExt,Zext) that must be done to transform the type of LHS and RHS into the type of V is returned in CastOp. For example: %1 = icmp slt i32 %a, i32 4 %2 = sext i32 %a to i64 %3 = select i1 %1, i64 %2, i64 4 -> LHS = %a, RHS = i32 4, *CastOp = Instruction::SExt

Declared at: llvm/include/llvm/Analysis/ValueTracking.h:630

Parameters

llvm::Value* V
llvm::Value*& LHS
llvm::Value*& RHS
Instruction::CastOps* CastOp = nullptr
unsigned int Depth = 0