Skip to content

Commit f615269

Browse files
authored
Revert "[WebAssembly] Constant fold wasm.dot" (#152382)
Reverts #149619 It breaks ubsan bot: https://lab.llvm.org/buildbot/#/builders/25/builds/10523 Earlier today the failure was hidden by another breakage that is fixed now.
1 parent d897355 commit f615269

File tree

2 files changed

+0
-81
lines changed

2 files changed

+0
-81
lines changed

llvm/lib/Analysis/ConstantFolding.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,6 @@ bool llvm::canConstantFoldCallTo(const CallBase *Call, const Function *F) {
16591659
case Intrinsic::aarch64_sve_convert_from_svbool:
16601660
case Intrinsic::wasm_alltrue:
16611661
case Intrinsic::wasm_anytrue:
1662-
case Intrinsic::wasm_dot:
16631662
// WebAssembly float semantics are always known
16641663
case Intrinsic::wasm_trunc_signed:
16651664
case Intrinsic::wasm_trunc_unsigned:
@@ -3990,30 +3989,6 @@ static Constant *ConstantFoldFixedVectorCall(
39903989
}
39913990
return ConstantVector::get(Result);
39923991
}
3993-
case Intrinsic::wasm_dot: {
3994-
unsigned NumElements =
3995-
cast<FixedVectorType>(Operands[0]->getType())->getNumElements();
3996-
3997-
assert(NumElements == 8 && Result.size() == 4 &&
3998-
"wasm dot takes i16x8 and produces i32x4");
3999-
assert(Ty->isIntegerTy());
4000-
int32_t MulVector[8];
4001-
4002-
for (unsigned I = 0; I < NumElements; ++I) {
4003-
ConstantInt *Elt0 =
4004-
cast<ConstantInt>(Operands[0]->getAggregateElement(I));
4005-
ConstantInt *Elt1 =
4006-
cast<ConstantInt>(Operands[1]->getAggregateElement(I));
4007-
4008-
MulVector[I] = Elt0->getSExtValue() * Elt1->getSExtValue();
4009-
}
4010-
for (unsigned I = 0; I < Result.size(); I++) {
4011-
int32_t IAdd = MulVector[I * 2] + MulVector[I * 2 + 1];
4012-
Result[I] = ConstantInt::get(Ty, IAdd);
4013-
}
4014-
4015-
return ConstantVector::get(Result);
4016-
}
40173992
default:
40183993
break;
40193994
}

llvm/test/Transforms/InstSimplify/ConstProp/WebAssembly/dot.ll

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)