From a696b1b64179bdbad1176eaf549be8661d83fa1d Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Thu, 8 Sep 2016 17:42:14 +0000 Subject: [PATCH] [Hexagon] Expand sext- and zextloads of vector types, not just extloads Recent change exposed this issue, breaking the Hexagon buildbots. llvm-svn: 280973 --- llvm/lib/Target/Hexagon/HexagonISelLowering.cpp | 6 +++++- llvm/test/CodeGen/Hexagon/vector-ext-load.ll | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 llvm/test/CodeGen/Hexagon/vector-ext-load.ll diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp index 8e113b9..34f553a 100644 --- a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp +++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp @@ -1968,9 +1968,13 @@ HexagonTargetLowering::HexagonTargetLowering(const TargetMachine &TM, for (unsigned VectExpOp : VectExpOps) setOperationAction(VectExpOp, VT, Expand); - // Expand all extended loads and truncating stores: + // Expand all extending loads and truncating stores: for (MVT TargetVT : MVT::vector_valuetypes()) { + if (TargetVT == VT) + continue; setLoadExtAction(ISD::EXTLOAD, TargetVT, VT, Expand); + setLoadExtAction(ISD::ZEXTLOAD, TargetVT, VT, Expand); + setLoadExtAction(ISD::SEXTLOAD, TargetVT, VT, Expand); setTruncStoreAction(VT, TargetVT, Expand); } diff --git a/llvm/test/CodeGen/Hexagon/vector-ext-load.ll b/llvm/test/CodeGen/Hexagon/vector-ext-load.ll new file mode 100644 index 0000000..536dad1 --- /dev/null +++ b/llvm/test/CodeGen/Hexagon/vector-ext-load.ll @@ -0,0 +1,10 @@ +; A copy of 2012-06-08-APIntCrash.ll with arch explicitly set to hexagon. + +; RUN: llc -march=hexagon < %s + +define void @test1(<8 x i32>* %ptr) { + %1 = load <8 x i32>, <8 x i32>* %ptr, align 32 + %2 = and <8 x i32> %1, + store <8 x i32> %2, <8 x i32>* %ptr, align 16 + ret void +} -- 2.7.4