[Cost]Canonicalize the cost for logical or/and reductions.
authorAlexey Bataev <a.bataev@outlook.com>
Tue, 2 Mar 2021 18:53:49 +0000 (10:53 -0800)
committerAlexey Bataev <a.bataev@outlook.com>
Fri, 19 Mar 2021 18:01:58 +0000 (11:01 -0700)
commit14ae0cf0f5cde5a5e64b955dfda5b5af3e882cdb
tree10e0a10a1bd6c6bd873bc97ed018dd4430dc37c8
parent5737010a7948441c78c2a367afa7c86efc8ae268
[Cost]Canonicalize the cost for logical or/and reductions.

The generic cost of logical or/and reductions should be cost of bitcast
<ReduxWidth x i1> to iReduxWidth + cmp eq|ne iReduxWidth.

Differential Revision: https://reviews.llvm.org/D97961
14 files changed:
llvm/include/llvm/CodeGen/BasicTTIImpl.h
llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
llvm/test/Analysis/CostModel/AArch64/reduce-and.ll
llvm/test/Analysis/CostModel/AArch64/reduce-or.ll
llvm/test/Analysis/CostModel/AMDGPU/reduce-and.ll
llvm/test/Analysis/CostModel/AMDGPU/reduce-or.ll
llvm/test/Analysis/CostModel/ARM/reduce-and.ll
llvm/test/Analysis/CostModel/ARM/reduce-or.ll
llvm/test/Analysis/CostModel/PowerPC/reduce-and.ll
llvm/test/Analysis/CostModel/PowerPC/reduce-or.ll
llvm/test/Analysis/CostModel/RISCV/reduce-and.ll
llvm/test/Analysis/CostModel/RISCV/reduce-or.ll
llvm/test/Analysis/CostModel/SystemZ/reduce-and.ll
llvm/test/Analysis/CostModel/SystemZ/reduce-or.ll