Skip to content

Commit

Permalink
[X86] LowerBITREVERSE - use AND+CMPEQ+MOVMSK trick to lower i8/i16/i3…
Browse files Browse the repository at this point in the history
…2 scalar types

By splitting each byte of a scalar type into 8 copies, in reverse order, we can then test each one to see if the bit is set and then use PMOVMSKB to pack them back together to get the bit reversal.

So far I've only managed to make this worth it for i8/i16 with SSSE3 (PSHUFB), i32 with AVX2 (AVX1 would be worth it if we can force all 256-bit operations to be split), and i64 with AVX512BW (which can use VPTESTMB).

Fixes llvm#79794
  • Loading branch information
RKSimon committed May 15, 2024
1 parent ca4a405 commit dd32f93
Show file tree
Hide file tree
Showing 7 changed files with 450 additions and 162 deletions.
51 changes: 50 additions & 1 deletion llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,8 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
setOperationAction(ISD::BITREVERSE, VT, Custom);
setOperationAction(ISD::CTLZ, VT, Custom);
}
setOperationAction(ISD::BITREVERSE, MVT::i8, Custom);
setOperationAction(ISD::BITREVERSE, MVT::i16, Custom);

// These might be better off as horizontal vector ops.
setOperationAction(ISD::ADD, MVT::i16, Custom);
Expand Down Expand Up @@ -1520,6 +1522,10 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
setCondCodeAction(ISD::SETLE, VT, Custom);
}

// TODO: Support AVX1 once i32 bitreverse codegen is better.
if (Subtarget.hasInt256())
setOperationAction(ISD::BITREVERSE, MVT::i32, Custom);

setOperationAction(ISD::SETCC, MVT::v4f64, Custom);
setOperationAction(ISD::SETCC, MVT::v8f32, Custom);
setOperationAction(ISD::STRICT_FSETCC, MVT::v4f64, Custom);
Expand Down Expand Up @@ -1916,6 +1922,9 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
setCondCodeAction(ISD::SETLE, VT, Custom);
}

if (HasBWI)
setOperationAction(ISD::BITREVERSE, MVT::i64, Custom);

setOperationAction(ISD::SETCC, MVT::v8f64, Custom);
setOperationAction(ISD::SETCC, MVT::v16f32, Custom);
setOperationAction(ISD::STRICT_FSETCC, MVT::v8f64, Custom);
Expand Down Expand Up @@ -31439,11 +31448,51 @@ static SDValue LowerBITREVERSE(SDValue Op, const X86Subtarget &Subtarget,
if (VT.is256BitVector() && !Subtarget.hasInt256())
return splitVectorIntUnary(Op, DAG, DL);

// Lower i8/i16/i32/i64 as vXi8 BITREVERSE + BSWAP
if (!VT.isVector()) {
assert(
(VT == MVT::i32 || VT == MVT::i64 || VT == MVT::i16 || VT == MVT::i8) &&
"Only tested for i8/i16/i32/i64");

// Lower i8/i16/i32 with vXi8 AND+CMPEQ+MOVMSK trick.
// Broadcast each byte across 8 bytes in byteswaped order, test if each bit
// is set and use MOVMSK/VPTESTMB to pack the bit results together.
if (!Subtarget.hasGFNI()) {
assert((VT == MVT::i8 || VT == MVT::i16 ||
(VT == MVT::i32 && Subtarget.hasInt256()) ||
(VT == MVT::i64 && Subtarget.hasBWI())) &&
"Unsupported scalar bitreverse");
unsigned VecBits = std::max<unsigned>(VT.getSizeInBits() * 8, 128);
unsigned NumBytes = VecBits / 8;
MVT ConstVT = MVT::getVectorVT(MVT::i64, VecBits / 64);
MVT ByteVT = MVT::getVectorVT(MVT::i8, VecBits / 8);
MVT SrcVT = MVT::getVectorVT(VT, VecBits / VT.getScalarSizeInBits());
SDValue Splat = DAG.getBitcast(ByteVT, DAG.getSplat(SrcVT, DL, In));

// Repeat each byte 8 times in reverse order.
SmallVector<int, 32> ByteSplatMask;
for (unsigned I = 0, E = VT.getSizeInBits() / 8; I != E; ++I)
ByteSplatMask.append(8, (E - 1) - I);
ByteSplatMask.append(NumBytes - ByteSplatMask.size(), -1);
SDValue Bytes =
DAG.getVectorShuffle(ByteVT, DL, Splat, Splat, ByteSplatMask);

SDValue Mask = DAG.getBitcast(
ByteVT, DAG.getConstant(0x102040810204080ULL, DL, ConstVT));
SDValue And = DAG.getNode(ISD::AND, DL, ByteVT, Bytes, Mask);
if (Subtarget.hasBWI() && (VT == MVT::i64 || Subtarget.hasVLX())) {
MVT CmpVT = MVT::getVectorVT(MVT::i1, NumBytes);
SDValue Zero = DAG.getConstant(0, DL, ByteVT);
SDValue Cmp = DAG.getSetCC(DL, CmpVT, And, Zero, ISD::CondCode::SETNE);
SDValue Msk = DAG.getBitcast(MVT::getIntegerVT(NumBytes), Cmp);
return DAG.getZExtOrTrunc(Msk, DL, VT);
} else {
SDValue Cmp = DAG.getSetCC(DL, ByteVT, And, Mask, ISD::CondCode::SETEQ);
SDValue Msk = getPMOVMSKB(DL, Cmp, DAG, Subtarget);
return DAG.getZExtOrTrunc(Msk, DL, VT);
}
}

// Lower i8/i16/i32/i64 as vXi8 BITREVERSE + BSWAP
MVT VecVT = MVT::getVectorVT(VT, 128 / VT.getSizeInBits());
SDValue Res = DAG.getNode(ISD::SCALAR_TO_VECTOR, DL, VecVT, In);
Res = DAG.getNode(ISD::BITREVERSE, DL, MVT::v16i8,
Expand Down
2 changes: 2 additions & 0 deletions llvm/lib/Target/X86/X86TargetTransformInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3959,6 +3959,8 @@ X86TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
{ ISD::BITREVERSE, MVT::v4i32, { 16, 20, 11, 21 } },
{ ISD::BITREVERSE, MVT::v8i16, { 16, 20, 11, 21 } },
{ ISD::BITREVERSE, MVT::v16i8, { 11, 12, 10, 16 } },
{ ISD::BITREVERSE, MVT::i16, { 5, 6, 6, 10 } }, // AND+PCMPEQB+PMOVMSKB
{ ISD::BITREVERSE, MVT::i8, { 4, 4, 7, 8 } }, // AND+PCMPEQB+PMOVMSKB
{ ISD::BSWAP, MVT::v2i64, { 2, 3, 1, 5 } },
{ ISD::BSWAP, MVT::v4i32, { 2, 3, 1, 5 } },
{ ISD::BSWAP, MVT::v8i16, { 2, 3, 1, 5 } },
Expand Down
28 changes: 20 additions & 8 deletions llvm/test/Analysis/CostModel/X86/bitreverse-codesize.ll
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,25 @@ define i32 @var_bitreverse_i32(i32 %a) {
}

define i16 @var_bitreverse_i16(i16 %a) {
; X86-LABEL: 'var_bitreverse_i16'
; X86-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; X86-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
; SSE2-LABEL: 'var_bitreverse_i16'
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
;
; X64-LABEL: 'var_bitreverse_i16'
; X64-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; X64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
; SSE42-LABEL: 'var_bitreverse_i16'
; SSE42-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
;
; AVX1-LABEL: 'var_bitreverse_i16'
; AVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
;
; AVX2-LABEL: 'var_bitreverse_i16'
; AVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
;
; AVX512-LABEL: 'var_bitreverse_i16'
; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
;
; XOP-LABEL: 'var_bitreverse_i16'
; XOP-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
Expand Down Expand Up @@ -139,11 +151,11 @@ define i16 @var_bitreverse_i16(i16 %a) {

define i8 @var_bitreverse_i8(i8 %a) {
; X86-LABEL: 'var_bitreverse_i8'
; X86-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; X86-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; X86-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
;
; X64-LABEL: 'var_bitreverse_i8'
; X64-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; X64-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; X64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
;
; XOP-LABEL: 'var_bitreverse_i8'
Expand Down
48 changes: 36 additions & 12 deletions llvm/test/Analysis/CostModel/X86/bitreverse-latency.ll
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,25 @@ define i32 @var_bitreverse_i32(i32 %a) {
}

define i16 @var_bitreverse_i16(i16 %a) {
; X86-LABEL: 'var_bitreverse_i16'
; X86-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; X86-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
; SSE2-LABEL: 'var_bitreverse_i16'
; SSE2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
;
; X64-LABEL: 'var_bitreverse_i16'
; X64-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; X64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
; SSE42-LABEL: 'var_bitreverse_i16'
; SSE42-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
;
; AVX1-LABEL: 'var_bitreverse_i16'
; AVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
;
; AVX2-LABEL: 'var_bitreverse_i16'
; AVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
;
; AVX512-LABEL: 'var_bitreverse_i16'
; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
;
; XOP-LABEL: 'var_bitreverse_i16'
; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
Expand Down Expand Up @@ -138,13 +150,25 @@ define i16 @var_bitreverse_i16(i16 %a) {
}

define i8 @var_bitreverse_i8(i8 %a) {
; X86-LABEL: 'var_bitreverse_i8'
; X86-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; X86-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
; SSE2-LABEL: 'var_bitreverse_i8'
; SSE2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
;
; SSE42-LABEL: 'var_bitreverse_i8'
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
;
; AVX1-LABEL: 'var_bitreverse_i8'
; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
;
; AVX2-LABEL: 'var_bitreverse_i8'
; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
;
; X64-LABEL: 'var_bitreverse_i8'
; X64-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; X64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
; AVX512-LABEL: 'var_bitreverse_i8'
; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
;
; XOP-LABEL: 'var_bitreverse_i8'
; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
Expand Down
28 changes: 20 additions & 8 deletions llvm/test/Analysis/CostModel/X86/bitreverse-sizelatency.ll
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ define i32 @var_bitreverse_i32(i32 %a) {

define i16 @var_bitreverse_i16(i16 %a) {
; X86-LABEL: 'var_bitreverse_i16'
; X86-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; X86-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; X86-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
;
; X64-LABEL: 'var_bitreverse_i16'
; X64-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; X64-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; X64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %bitreverse
;
; XOP-LABEL: 'var_bitreverse_i16'
Expand Down Expand Up @@ -138,13 +138,25 @@ define i16 @var_bitreverse_i16(i16 %a) {
}

define i8 @var_bitreverse_i8(i8 %a) {
; X86-LABEL: 'var_bitreverse_i8'
; X86-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; X86-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
; SSE2-LABEL: 'var_bitreverse_i8'
; SSE2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
;
; X64-LABEL: 'var_bitreverse_i8'
; X64-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; X64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
; SSE42-LABEL: 'var_bitreverse_i8'
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
;
; AVX1-LABEL: 'var_bitreverse_i8'
; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
;
; AVX2-LABEL: 'var_bitreverse_i8'
; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
;
; AVX512-LABEL: 'var_bitreverse_i8'
; AVX512-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %bitreverse
;
; XOP-LABEL: 'var_bitreverse_i8'
; XOP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
Expand Down
48 changes: 36 additions & 12 deletions llvm/test/Analysis/CostModel/X86/bitreverse.ll
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,25 @@ define i32 @var_bitreverse_i32(i32 %a) {
}

define i16 @var_bitreverse_i16(i16 %a) {
; X86-LABEL: 'var_bitreverse_i16'
; X86-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; X86-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %bitreverse
; SSE2-LABEL: 'var_bitreverse_i16'
; SSE2-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %bitreverse
;
; X64-LABEL: 'var_bitreverse_i16'
; X64-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; X64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %bitreverse
; SSE42-LABEL: 'var_bitreverse_i16'
; SSE42-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %bitreverse
;
; AVX1-LABEL: 'var_bitreverse_i16'
; AVX1-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %bitreverse
;
; AVX2-LABEL: 'var_bitreverse_i16'
; AVX2-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %bitreverse
;
; AVX512-LABEL: 'var_bitreverse_i16'
; AVX512-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %bitreverse
;
; XOP-LABEL: 'var_bitreverse_i16'
; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
Expand Down Expand Up @@ -138,13 +150,25 @@ define i16 @var_bitreverse_i16(i16 %a) {
}

define i8 @var_bitreverse_i8(i8 %a) {
; X86-LABEL: 'var_bitreverse_i8'
; X86-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; X86-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %bitreverse
; SSE2-LABEL: 'var_bitreverse_i8'
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %bitreverse
;
; SSE42-LABEL: 'var_bitreverse_i8'
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %bitreverse
;
; AVX1-LABEL: 'var_bitreverse_i8'
; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %bitreverse
;
; AVX2-LABEL: 'var_bitreverse_i8'
; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %bitreverse
;
; X64-LABEL: 'var_bitreverse_i8'
; X64-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; X64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %bitreverse
; AVX512-LABEL: 'var_bitreverse_i8'
; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %bitreverse
;
; XOP-LABEL: 'var_bitreverse_i8'
; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %bitreverse = call i8 @llvm.bitreverse.i8(i8 %a)
Expand Down
Loading

0 comments on commit dd32f93

Please sign in to comment.