[PATCH] D80324: [SVE] Eliminate calls to default-false VectorType::get() from Analysis
Christopher Tetreault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 20 14:53:45 PDT 2020
ctetreau created this revision.
Herald added subscribers: llvm-commits, psnobl, rkruppe, hiraditya, tschuett.
Herald added a reviewer: efriedma.
Herald added a project: LLVM.
ctetreau added reviewers: fpetrogalli, kmclaughlin, sunfish.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D80324
Files:
llvm/lib/Analysis/ConstantFolding.cpp
Index: llvm/lib/Analysis/ConstantFolding.cpp
===================================================================
--- llvm/lib/Analysis/ConstantFolding.cpp
+++ llvm/lib/Analysis/ConstantFolding.cpp
@@ -118,8 +118,8 @@
// to simplify things.
if (SrcEltTy->isFloatingPointTy()) {
unsigned FPWidth = SrcEltTy->getPrimitiveSizeInBits();
- Type *SrcIVTy =
- VectorType::get(IntegerType::get(C->getContext(), FPWidth), NumSrcElts);
+ auto *SrcIVTy = FixedVectorType::get(
+ IntegerType::get(C->getContext(), FPWidth), NumSrcElts);
// Ask IR to do the conversion now that #elts line up.
C = ConstantExpr::getBitCast(C, SrcIVTy);
}
@@ -175,8 +175,8 @@
if (DstEltTy->isFloatingPointTy()) {
// Fold to an vector of integers with same size as our FP type.
unsigned FPWidth = DstEltTy->getPrimitiveSizeInBits();
- Type *DestIVTy =
- VectorType::get(IntegerType::get(C->getContext(), FPWidth), NumDstElt);
+ auto *DestIVTy = FixedVectorType::get(
+ IntegerType::get(C->getContext(), FPWidth), NumDstElt);
// Recursively handle this integer conversion, if possible.
C = FoldBitCast(C, DestIVTy, DL);
@@ -188,8 +188,8 @@
// it to integer first.
if (SrcEltTy->isFloatingPointTy()) {
unsigned FPWidth = SrcEltTy->getPrimitiveSizeInBits();
- Type *SrcIVTy =
- VectorType::get(IntegerType::get(C->getContext(), FPWidth), NumSrcElt);
+ auto *SrcIVTy = FixedVectorType::get(
+ IntegerType::get(C->getContext(), FPWidth), NumSrcElt);
// Ask IR to do the conversion now that #elts line up.
C = ConstantExpr::getBitCast(C, SrcIVTy);
// If IR wasn't able to fold it, bail out.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80324.265350.patch
Type: text/x-patch
Size: 1720 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200520/3a2b130a/attachment-0001.bin>
More information about the llvm-commits
mailing list