Skip to content

Commit

Permalink
[Codegen][LLVMCPU] Use output element type to decide if reduction is …
Browse files Browse the repository at this point in the history
…over integers. (#14965)

Using the input type might lead to incorrect behavior of always enabling
associative reordering (irrespective of whether the override flag
`--iree-llvmcpu-reassociate-fp-reductions=false` is set or not). The
output element type has to be used to make sure the flag is enforced
correctly.

Towards #14934
  • Loading branch information
MaheshRavishankar authored Sep 12, 2023
1 parent ec74fe0 commit 0c3f73a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ LogicalResult splitReductionPrecondition(Operation *op,
}

auto elemType =
getElementTypeOrSelf(linalgOp.getDpsInputOperand(0)->get().getType());
getElementTypeOrSelf(linalgOp.getDpsInitOperand(0)->get().getType());
if (!(fpReductionReordering || elemType.isIntOrIndex())) {
LLVM_DEBUG(
llvm::dbgs()
Expand Down

0 comments on commit 0c3f73a

Please sign in to comment.