[llvm] 7474869 - [SVE] Fix bad FixedVectorType cast in simplifyDivRem
Christopher Tetreault via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 16 13:17:24 PDT 2020
Author: Christopher Tetreault
Date: 2020-06-16T13:17:05-07:00
New Revision: 747486991cc452f7a1861e4a7a30d069d5f34aab
URL: https://github.com/llvm/llvm-project/commit/747486991cc452f7a1861e4a7a30d069d5f34aab
DIFF: https://github.com/llvm/llvm-project/commit/747486991cc452f7a1861e4a7a30d069d5f34aab.diff
LOG: [SVE] Fix bad FixedVectorType cast in simplifyDivRem
Summary:
simplifyDivRem attempts to walk a VectorType elementwise. Ensure that it
only does so for FixedVectorType
Reviewers: efriedma, spatel, lebedev.ri, david-arm, kmclaughlin
Reviewed By: spatel, david-arm
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81856
Added:
Modified:
llvm/lib/Analysis/InstructionSimplify.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index 63f545306630..02d945beabab 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -942,10 +942,10 @@ static Value *simplifyDivRem(Value *Op0, Value *Op1, bool IsDiv) {
if (match(Op1, m_Zero()))
return UndefValue::get(Ty);
- // If any element of a constant divisor vector is zero or undef, the whole op
- // is undef.
+ // If any element of a constant divisor fixed width vector is zero or undef,
+ // the whole op is undef.
auto *Op1C = dyn_cast<Constant>(Op1);
- auto *VTy = dyn_cast<VectorType>(Ty);
+ auto *VTy = dyn_cast<FixedVectorType>(Ty);
if (Op1C && VTy) {
unsigned NumElts = VTy->getNumElements();
for (unsigned i = 0; i != NumElts; ++i) {
More information about the llvm-commits
mailing list