llvm::matchSimpleTernaryIntrinsicRecurrence

Match a simple ternary-intrinsic value-accumulating recurrence.

Synopsis

Declared in <llvm/Analysis/ValueTracking.h>

bool
matchSimpleTernaryIntrinsicRecurrence(
    IntrinsicInst const* I,
    PHINode*& P,
    Value*& Init,
    Value*& OtherOp0,
    Value*& OtherOp1);

Description

Attempt to match a simple value-accumulating recurrence of the form: %llvm.intrinsic.acc = phi Ty [%Init, %Entry], [%llvm.intrinsic, %backedge] %llvm.intrinsic = call Ty llvm.intrinsic(%OtherOp0, %OtherOp1, %llvm.intrinsic.acc) OR %llvm.intrinsic.acc = phi Ty [%Init, %Entry], [%llvm.intrinsic, %backedge] %llvm.intrinsic = call Ty llvm.intrinsic(%llvm.intrinsic.acc, %OtherOp0, %OtherOp1)

The recurrence relation is of kind: X_0 = %a (initial value), X_i = call llvm.ternary.intrinsic(X_i-1, %b, %c) Where %b, %c are not required to be loop-invariant.

Return Value

True if a simple ternary intrinsic recurrence was matched.

Parameters

NameDescription
IIntrinsic call that may be the recurrence update.
POutput phi accumulator of the matched recurrence.
InitOutput initial value of the accumulator.
OtherOp0Output first non-accumulator operand of the intrinsic.
OtherOp1Output second non-accumulator operand of the intrinsic.