LLVMReactor: Fix the signature of a few instrinsics
The 2nd boolean parameter is not part of the name (for example llvm.ctlz.i8).
Caught by the IR verifier which gets automatically run with coroutines.
Bug: b/131914569
Bug: b/126873455
Change-Id: I1ce325c9bf64587f5c9c0a1a0129b80ef19e07f1
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/30449
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp
index 520f1a0..bb24c2a 100644
--- a/src/Reactor/LLVMReactor.cpp
+++ b/src/Reactor/LLVMReactor.cpp
@@ -3444,10 +3444,7 @@
RValue<Float4> Pow(RValue<Float4> x, RValue<Float4> y)
{
- ::llvm::SmallVector<::llvm::Type*, 2> paramTys;
- paramTys.push_back(T(Float4::getType()));
- paramTys.push_back(T(Float4::getType()));
- auto func = llvm::Intrinsic::getDeclaration(::module, llvm::Intrinsic::pow, paramTys);
+ auto func = llvm::Intrinsic::getDeclaration(::module, llvm::Intrinsic::pow, { T(Float4::getType()) });
return RValue<Float4>(V(::builder->CreateCall2(func, ARGS(V(x.value), V(y.value)))));
}
@@ -3477,10 +3474,7 @@
RValue<UInt4> Ctlz(RValue<UInt4> v, bool isZeroUndef)
{
- ::llvm::SmallVector<::llvm::Type*, 2> paramTys;
- paramTys.push_back(T(UInt4::getType()));
- paramTys.push_back(T(Bool::getType()));
- auto func = llvm::Intrinsic::getDeclaration(::module, llvm::Intrinsic::ctlz, paramTys);
+ auto func = llvm::Intrinsic::getDeclaration(::module, llvm::Intrinsic::ctlz, { T(UInt4::getType()) } );
return RValue<UInt4>(V(::builder->CreateCall2(func, ARGS(
V(v.value),
isZeroUndef ? ::llvm::ConstantInt::getTrue(*::context) : ::llvm::ConstantInt::getFalse(*::context)
@@ -3489,10 +3483,7 @@
RValue<UInt4> Cttz(RValue<UInt4> v, bool isZeroUndef)
{
- ::llvm::SmallVector<::llvm::Type*, 2> paramTys;
- paramTys.push_back(T(UInt4::getType()));
- paramTys.push_back(T(Bool::getType()));
- auto func = llvm::Intrinsic::getDeclaration(::module, llvm::Intrinsic::cttz, paramTys);
+ auto func = llvm::Intrinsic::getDeclaration(::module, llvm::Intrinsic::cttz, { T(UInt4::getType()) } );
return RValue<UInt4>(V(::builder->CreateCall2(func, ARGS(
V(v.value),
isZeroUndef ? ::llvm::ConstantInt::getTrue(*::context) : ::llvm::ConstantInt::getFalse(*::context)