Skip to content

Commit c429f61

Browse files
authored
Merge branch 'release/18.x' into SkipODRCheckInGMF
2 parents 494ef4a + aca7586 commit c429f61

File tree

4 files changed

+210
-194
lines changed

4 files changed

+210
-194
lines changed

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,20 @@ static bool hasPossibleIncompatibleOps(const Function *F) {
233233

234234
bool AArch64TTIImpl::areInlineCompatible(const Function *Caller,
235235
const Function *Callee) const {
236-
SMEAttrs CallerAttrs(*Caller);
237-
SMEAttrs CalleeAttrs(*Callee);
236+
SMEAttrs CallerAttrs(*Caller), CalleeAttrs(*Callee);
237+
238+
// When inlining, we should consider the body of the function, not the
239+
// interface.
240+
if (CalleeAttrs.hasStreamingBody()) {
241+
CalleeAttrs.set(SMEAttrs::SM_Compatible, false);
242+
CalleeAttrs.set(SMEAttrs::SM_Enabled, true);
243+
}
244+
238245
if (CalleeAttrs.hasNewZABody())
239246
return false;
240247

241248
if (CallerAttrs.requiresLazySave(CalleeAttrs) ||
242-
(CallerAttrs.requiresSMChange(CalleeAttrs) &&
243-
(!CallerAttrs.hasStreamingInterfaceOrBody() ||
244-
!CalleeAttrs.hasStreamingBody()))) {
249+
CallerAttrs.requiresSMChange(CalleeAttrs)) {
245250
if (hasPossibleIncompatibleOps(Callee))
246251
return false;
247252
}
@@ -4062,4 +4067,4 @@ bool AArch64TTIImpl::shouldTreatInstructionLikeSelect(const Instruction *I) {
40624067
cast<BranchInst>(I->getNextNode())->isUnconditional())
40634068
return true;
40644069
return BaseT::shouldTreatInstructionLikeSelect(I);
4065-
}
4070+
}

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4718,7 +4718,7 @@ static SDValue lowerShuffleViaVRegSplitting(ShuffleVectorSDNode *SVN,
47184718
if (SrcVecIdx == -1)
47194719
continue;
47204720
unsigned ExtractIdx = (SrcVecIdx % VRegsPerSrc) * NumOpElts;
4721-
SDValue SrcVec = (unsigned)SrcVecIdx > VRegsPerSrc ? V2 : V1;
4721+
SDValue SrcVec = (unsigned)SrcVecIdx >= VRegsPerSrc ? V2 : V1;
47224722
SDValue SubVec = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, M1VT, SrcVec,
47234723
DAG.getVectorIdxConstant(ExtractIdx, DL));
47244724
SubVec = convertFromScalableVector(OneRegVT, SubVec, DAG, Subtarget);

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-shuffle-exact-vlen.ll

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ define <4 x i64> @m2_splat_two_source(<4 x i64> %v1, <4 x i64> %v2) vscale_range
138138
ret <4 x i64> %res
139139
}
140140

141-
define <4 x i64> @m2_splat_into_identity_two_source(<4 x i64> %v1, <4 x i64> %v2) vscale_range(2,2) {
142-
; CHECK-LABEL: m2_splat_into_identity_two_source:
141+
define <4 x i64> @m2_splat_into_identity_two_source_v2_hi(<4 x i64> %v1, <4 x i64> %v2) vscale_range(2,2) {
142+
; CHECK-LABEL: m2_splat_into_identity_two_source_v2_hi:
143143
; CHECK: # %bb.0:
144144
; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
145145
; CHECK-NEXT: vrgather.vi v10, v8, 0
@@ -149,6 +149,18 @@ define <4 x i64> @m2_splat_into_identity_two_source(<4 x i64> %v1, <4 x i64> %v2
149149
ret <4 x i64> %res
150150
}
151151

152+
define <4 x i64> @m2_splat_into_slide_two_source_v2_lo(<4 x i64> %v1, <4 x i64> %v2) vscale_range(2,2) {
153+
; CHECK-LABEL: m2_splat_into_slide_two_source_v2_lo:
154+
; CHECK: # %bb.0:
155+
; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
156+
; CHECK-NEXT: vrgather.vi v12, v8, 0
157+
; CHECK-NEXT: vmv1r.v v13, v10
158+
; CHECK-NEXT: vmv2r.v v8, v12
159+
; CHECK-NEXT: ret
160+
%res = shufflevector <4 x i64> %v1, <4 x i64> %v2, <4 x i32> <i32 0, i32 0, i32 4, i32 5>
161+
ret <4 x i64> %res
162+
}
163+
152164
define <4 x i64> @m2_splat_into_slide_two_source(<4 x i64> %v1, <4 x i64> %v2) vscale_range(2,2) {
153165
; CHECK-LABEL: m2_splat_into_slide_two_source:
154166
; CHECK: # %bb.0:

0 commit comments

Comments
 (0)