[SVE] Remove calls to getBitWidth from AArch64
authorChristopher Tetreault <ctetreau@quicinc.com>
Tue, 14 Apr 2020 17:06:23 +0000 (10:06 -0700)
committerChristopher Tetreault <ctetreau@quicinc.com>
Tue, 14 Apr 2020 17:26:37 +0000 (10:26 -0700)
Reviewers: efriedma

Reviewed By: efriedma

Subscribers: danielkiss, tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77905

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

index e1179ec..c06c20d 100644 (file)
@@ -9196,9 +9196,10 @@ bool AArch64TargetLowering::isExtFreeImpl(const Instruction *Ext) const {
 /// or upper half of the vector elements.
 static bool areExtractShuffleVectors(Value *Op1, Value *Op2) {
   auto areTypesHalfed = [](Value *FullV, Value *HalfV) {
-    auto *FullVT = cast<VectorType>(FullV->getType());
-    auto *HalfVT = cast<VectorType>(HalfV->getType());
-    return FullVT->getBitWidth() == 2 * HalfVT->getBitWidth();
+    auto *FullTy = FullV->getType();
+    auto *HalfTy = HalfV->getType();
+    return FullTy->getPrimitiveSizeInBits().getFixedSize() ==
+           2 * HalfTy->getPrimitiveSizeInBits().getFixedSize();
   };
 
   auto extractHalf = [](Value *FullV, Value *HalfV) {