[PATCH] D12974: [ARM] Do not scale vext with a factor

Jeroen Ketema via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 13:29:44 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL248208: [ARM] Do not scale vext with a factor (authored by jketema).

Changed prior to commit:
  http://reviews.llvm.org/D12974?vs=35103&id=35300#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12974

Files:
  llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
  llvm/trunk/test/CodeGen/ARM/vzip.ll

Index: llvm/trunk/test/CodeGen/ARM/vzip.ll
===================================================================
--- llvm/trunk/test/CodeGen/ARM/vzip.ll
+++ llvm/trunk/test/CodeGen/ARM/vzip.ll
@@ -305,3 +305,14 @@
   store <4 x i32> %0, <4 x i32>* %B
   ret void
 }
+
+define void @vzip_vext_factor(<8 x i16>* %A, <4 x i16>* %B) {
+entry:
+  ; CHECK-LABEL: vzip_vext_factor
+  ; CHECK: vext.16 d16, d16, d17, #3
+  ; CHECK: vzip
+  %tmp1 = load <8 x i16>, <8 x i16>* %A
+  %0 = shufflevector <8 x i16> %tmp1, <8 x i16> undef, <4 x i32> <i32 4, i32 4, i32 5, i32 3>
+  store <4 x i16> %0, <4 x i16>* %B
+  ret void
+}
Index: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
@@ -5515,13 +5515,6 @@
   return SDValue();
 }
 
-/// getExtFactor - Determine the adjustment factor for the position when
-/// generating an "extract from vector registers" instruction.
-static unsigned getExtFactor(SDValue &V) {
-  EVT EltType = V.getValueType().getVectorElementType();
-  return EltType.getSizeInBits() / 8;
-}
-
 // Gather data to see if the operation can be modelled as a
 // shuffle in combination with VEXTs.
 SDValue ARMTargetLowering::ReconstructShuffle(SDValue Op,
@@ -5652,11 +5645,10 @@
       SDValue VEXTSrc2 =
           DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, DestVT, Src.ShuffleVec,
                       DAG.getConstant(NumSrcElts, dl, MVT::i32));
-      unsigned Imm = Src.MinElt * getExtFactor(VEXTSrc1);
 
       Src.ShuffleVec = DAG.getNode(ARMISD::VEXT, dl, DestVT, VEXTSrc1,
                                    VEXTSrc2,
-                                   DAG.getConstant(Imm, dl, MVT::i32));
+                                   DAG.getConstant(Src.MinElt, dl, MVT::i32));
       Src.WindowBase = -Src.MinElt;
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12974.35300.patch
Type: text/x-patch
Size: 1901 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150921/6cef4f97/attachment.bin>


More information about the llvm-commits mailing list