1 Pull in r201718 from upstream llvm trunk (by Roman Divacky):
3 Expand 64bit {SHL,SHR,SRA}_PARTS on sparcv9.
5 Introduced here: http://svn.freebsd.org/changeset/base/262265
7 Index: test/CodeGen/SPARC/parts.ll
8 ===================================================================
9 --- test/CodeGen/SPARC/parts.ll
10 +++ test/CodeGen/SPARC/parts.ll
12 +; RUN: llc < %s -march=sparcv9 | FileCheck %s
15 +; CHECK: srl %i1, 0, %o2
16 +; CHECK-NEXT: or %g0, %i2, %o0
17 +; CHECK-NEXT: call __ashlti3
18 +; CHECK-NEXT: or %g0, %i3, %o1
19 +; CHECK-NEXT: or %g0, %o0, %i0
21 +define i128 @test(i128 %a, i128 %b) {
23 + %tmp = shl i128 %b, %a
26 Index: lib/Target/Sparc/SparcISelLowering.cpp
27 ===================================================================
28 --- lib/Target/Sparc/SparcISelLowering.cpp
29 +++ lib/Target/Sparc/SparcISelLowering.cpp
30 @@ -1554,6 +1554,10 @@ SparcTargetLowering::SparcTargetLowering(TargetMac
32 setOperationAction(ISD::UMULO, MVT::i64, Custom);
33 setOperationAction(ISD::SMULO, MVT::i64, Custom);
35 + setOperationAction(ISD::SHL_PARTS, MVT::i64, Expand);
36 + setOperationAction(ISD::SRA_PARTS, MVT::i64, Expand);
37 + setOperationAction(ISD::SRL_PARTS, MVT::i64, Expand);
40 // VASTART needs to be custom lowered to use the VarArgsFrameIndex.