aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/IntrinsicInst.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-02-22 17:13:00 +0100
committerNikita Popov <npopov@redhat.com>2023-02-23 15:30:29 +0100
commit8347ca7dc81adf16400306b4fc0702f62e69acd7 (patch)
treecb6ccf039dde9483cd6cc0431affe7fd43d1f462 /llvm/lib/IR/IntrinsicInst.cpp
parent34abc5b75d9d995ded56a9534c230300b06f1439 (diff)
downloadllvm-8347ca7dc81adf16400306b4fc0702f62e69acd7.zip
llvm-8347ca7dc81adf16400306b4fc0702f62e69acd7.tar.gz
llvm-8347ca7dc81adf16400306b4fc0702f62e69acd7.tar.bz2
[PatternMatch] Don't require DataLayout for m_VScale()
The m_VScale() matcher is unusual in that it requires a DataLayout. It is currently used to determine the size of the GEP type. However, I believe it is sufficient to check for the canonical <vscale x 1 x i8> form here -- I don't think there's a need to recognize exotic variations like <vscale x 1 x i4> as a vscale constant representation as well. Differential Revision: https://reviews.llvm.org/D144566
Diffstat (limited to 'llvm/lib/IR/IntrinsicInst.cpp')
-rw-r--r--llvm/lib/IR/IntrinsicInst.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp
index b258e7b..0bafa5f 100644
--- a/llvm/lib/IR/IntrinsicInst.cpp
+++ b/llvm/lib/IR/IntrinsicInst.cpp
@@ -554,17 +554,11 @@ bool VPIntrinsic::canIgnoreVectorLengthParam() const {
// Check whether "W == vscale * EC.getKnownMinValue()"
if (EC.isScalable()) {
- // Undig the DL
- const auto *ParMod = this->getModule();
- if (!ParMod)
- return false;
- const auto &DL = ParMod->getDataLayout();
-
// Compare vscale patterns
uint64_t VScaleFactor;
- if (match(VLParam, m_c_Mul(m_ConstantInt(VScaleFactor), m_VScale(DL))))
+ if (match(VLParam, m_c_Mul(m_ConstantInt(VScaleFactor), m_VScale())))
return VScaleFactor >= EC.getKnownMinValue();
- return (EC.getKnownMinValue() == 1) && match(VLParam, m_VScale(DL));
+ return (EC.getKnownMinValue() == 1) && match(VLParam, m_VScale());
}
// standard SIMD operation