diff options
author | Paul Walker <paul.walker@arm.com> | 2023-03-08 15:19:43 +0000 |
---|---|---|
committer | Paul Walker <paul.walker@arm.com> | 2023-03-08 15:47:03 +0000 |
commit | adbdf273efd584e58e7ef57d391b4e1885e7837f (patch) | |
tree | 9b5c804089e7314dcba563880847dc75e9aa046c /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | 5ece59b5a45c9d6717be1331ebb4688497c311e9 (diff) | |
download | llvm-adbdf273efd584e58e7ef57d391b4e1885e7837f.zip llvm-adbdf273efd584e58e7ef57d391b4e1885e7837f.tar.gz llvm-adbdf273efd584e58e7ef57d391b4e1885e7837f.tar.bz2 |
[CodeGenPrepare] Stop llvm.vscale() -> getelementptr(null, 1) transformation.
I've pulled this change from D145404 to land in isolation because
I'm concerned the code might be more important than the test
coverage might suggest (NOTE: the code has no test coverage).
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 0aa218a..79cd7060 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -2349,24 +2349,6 @@ bool CodeGenPrepare::optimizeCallInst(CallInst *CI, ModifyDT &ModifiedDT) { case Intrinsic::dbg_assign: case Intrinsic::dbg_value: return fixupDbgValue(II); - case Intrinsic::vscale: { - // If datalayout has no special restrictions on vector data layout, - // replace `llvm.vscale` by an equivalent constant expression - // to benefit from cheap constant propagation. - Type *ScalableVectorTy = - VectorType::get(Type::getInt8Ty(II->getContext()), 1, true); - if (DL->getTypeAllocSize(ScalableVectorTy).getKnownMinValue() == 8) { - auto *Null = Constant::getNullValue(ScalableVectorTy->getPointerTo()); - auto *One = ConstantInt::getSigned(II->getType(), 1); - auto *CGep = - ConstantExpr::getGetElementPtr(ScalableVectorTy, Null, One); - replaceAllUsesWith(II, ConstantExpr::getPtrToInt(CGep, II->getType()), - FreshBBs, IsHugeFunc); - II->eraseFromParent(); - return true; - } - break; - } case Intrinsic::masked_gather: return optimizeGatherScatterInst(II, II->getArgOperand(0)); case Intrinsic::masked_scatter: |