summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorTim Northover <t.p.northover@gmail.com>2020-01-09 14:28:48 +0000
committerTim Northover <t.p.northover@gmail.com>2020-01-14 13:41:32 +0000
commit77cc690bae310f4cba0a34f2da8a37a7c9a10a82 (patch)
tree2f5a775dd489f15d5b7142d976848b34def949fa /llvm/lib/IR
parentcfe2fab708de3a1d8e05a829a132f335a189acc9 (diff)
downloadbcm5719-llvm-77cc690bae310f4cba0a34f2da8a37a7c9a10a82.tar.gz
bcm5719-llvm-77cc690bae310f4cba0a34f2da8a37a7c9a10a82.zip
AArch64: fix bitcode upgrade of @llvm.neon.addp.
We were upgrading it to faddp, but a version taking two type parameters instead of one. This then got upgraded a second time to the version with just one parameter, but occasionally (for reasons I don't understand) this unusual two-stage process corrupted a use-list, leading to a crash when the two faddp declarations didn't match.
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/AutoUpgrade.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index ecd1a12c2e5..6e2beeb839b 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -585,11 +585,10 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
if (Name.startswith("aarch64.neon.addp")) {
if (F->arg_size() != 2)
break; // Invalid IR.
- auto fArgs = F->getFunctionType()->params();
- VectorType *ArgTy = dyn_cast<VectorType>(fArgs[0]);
- if (ArgTy && ArgTy->getElementType()->isFloatingPointTy()) {
+ VectorType *Ty = dyn_cast<VectorType>(F->getReturnType());
+ if (Ty && Ty->getElementType()->isFloatingPointTy()) {
NewFn = Intrinsic::getDeclaration(F->getParent(),
- Intrinsic::aarch64_neon_faddp, fArgs);
+ Intrinsic::aarch64_neon_faddp, Ty);
return true;
}
}
OpenPOWER on IntegriCloud