diff options
author | Simon Moll <simon.moll@emea.nec.com> | 2020-06-04 11:09:48 +0200 |
---|---|---|
committer | Simon Moll <simon.moll@emea.nec.com> | 2020-06-04 14:17:42 +0200 |
commit | a0dfdda4e5e8c3f33ccc80f289374a60943cb7c3 (patch) | |
tree | f4976216ac79b8ecf06add459649f4d3a7fb6a6e /llvm/lib/IR/IntrinsicInst.cpp | |
parent | 7d4ebc98afac1e8f749644589eae6b26ddd68811 (diff) | |
download | llvm-a0dfdda4e5e8c3f33ccc80f289374a60943cb7c3.zip llvm-a0dfdda4e5e8c3f33ccc80f289374a60943cb7c3.tar.gz llvm-a0dfdda4e5e8c3f33ccc80f289374a60943cb7c3.tar.bz2 |
[VP][Fix] canIgnoreVectorLength for scalable types
This patch fixes VPIntrinsic::canIgnoreVectorLength when used on a
VPIntrinsic with scalable vector types. Also includes new unittest cases
for the '<vscale x 1 x whatever>' and '%evl == vscale' corner cases.
Diffstat (limited to 'llvm/lib/IR/IntrinsicInst.cpp')
-rw-r--r-- | llvm/lib/IR/IntrinsicInst.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp index 6f6aefd..c4e06cd 100644 --- a/llvm/lib/IR/IntrinsicInst.cpp +++ b/llvm/lib/IR/IntrinsicInst.cpp @@ -289,15 +289,10 @@ bool VPIntrinsic::canIgnoreVectorLengthParam() const { const auto &DL = ParMod->getDataLayout(); // Compare vscale patterns - uint64_t ParamFactor; - if (EC.Min > 1 && - match(VLParam, m_c_BinOp(m_ConstantInt(ParamFactor), m_VScale(DL)))) { - return ParamFactor >= EC.Min; - } - if (match(VLParam, m_VScale(DL))) { - return ParamFactor; - } - return false; + uint64_t VScaleFactor; + if (match(VLParam, m_c_Mul(m_ConstantInt(VScaleFactor), m_VScale(DL)))) + return VScaleFactor >= EC.Min; + return (EC.Min == 1) && match(VLParam, m_VScale(DL)); } // standard SIMD operation |