Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:GA
llvm.7809
backport-llvm-r236530
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File backport-llvm-r236530 of Package llvm.7809
------------------------------------------------------------------------ r236530 | uweigand | 2015-05-05 21:34:10 +0200 (Tue, 05 May 2015) | 10 lines [DAGCombiner] Account for getVectorIdxTy() when narrowing vector load This patch makes ReplaceExtractVectorEltOfLoadWithNarrowedLoad convert the element number from getVectorIdxTy() to PtrTy before doing pointer arithmetic on it. This is needed on z, where element numbers are i32 but pointers are i64. Original patch by Richard Sandiford. ------------------------------------------------------------------------ Index: test/CodeGen/SystemZ/vec-extract-02.ll =================================================================== --- /dev/null +++ test/CodeGen/SystemZ/vec-extract-02.ll @@ -0,0 +1,15 @@ +; Verify ReplaceExtractVectorEltOfLoadWithNarrowedLoad fixes +; +; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s + +; Test a case where a vector extraction can be simplified to a scalar load. +; The index must be extended from i32 to i64. +define i32 @f1(<4 x i32> *%ptr, i32 %index) { +; CHECK-LABEL: f1: +; CHECK: risbg {{%r[0-5]}}, %r3, 30, 189, 2 +; CHECK: l %r2, +; CHECK: br %r14 + %vec = load <4 x i32> *%ptr + %res = extractelement <4 x i32> %vec, i32 %index + ret i32 %res +} Index: lib/CodeGen/SelectionDAG/DAGCombiner.cpp =================================================================== --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp.orig +++ lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -9331,9 +9331,10 @@ SDValue DAGCombiner::ReplaceExtractVecto Offset = DAG.getConstant(PtrOff, PtrType); MPI = OriginalLoad->getPointerInfo().getWithOffset(PtrOff); } else { + Offset = DAG.getZExtOrTrunc(EltNo, SDLoc(EVE), PtrType); Offset = DAG.getNode( - ISD::MUL, SDLoc(EVE), EltNo.getValueType(), EltNo, - DAG.getConstant(VecEltVT.getStoreSize(), EltNo.getValueType())); + ISD::MUL, SDLoc(EVE), PtrType, Offset, + DAG.getConstant(VecEltVT.getStoreSize(), PtrType)); MPI = OriginalLoad->getPointerInfo(); } NewPtr = DAG.getNode(ISD::ADD, SDLoc(EVE), PtrType, NewPtr, Offset);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor