Skip to content

Commit f9b945f

Browse files
Add fix for RegisterCoalescer
1 parent 53af501 commit f9b945f

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

llvm/lib/CodeGen/RegisterCoalescer.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3671,6 +3671,14 @@ bool RegisterCoalescer::joinVirtRegs(CoalescerPair &CP) {
36713671
// having stale segments.
36723672
LHSVals.pruneMainSegments(LHS, ShrinkMainRange);
36733673

3674+
LHSVals.pruneSubRegValues(LHS, ShrinkMask);
3675+
RHSVals.pruneSubRegValues(LHS, ShrinkMask);
3676+
} else if (TrackSubRegLiveness && !CP.getDstIdx() && CP.getSrcIdx()) {
3677+
LHS.createSubRangeFrom(LIS->getVNInfoAllocator(),
3678+
CP.getNewRC()->getLaneMask(), LHS);
3679+
mergeSubRangeInto(LHS, RHS, TRI->getSubRegIndexLaneMask(CP.getSrcIdx()), CP,
3680+
CP.getDstIdx());
3681+
LHSVals.pruneMainSegments(LHS, ShrinkMainRange);
36743682
LHSVals.pruneSubRegValues(LHS, ShrinkMask);
36753683
RHSVals.pruneSubRegValues(LHS, ShrinkMask);
36763684
}

llvm/lib/Target/PowerPC/PPCRegisterInfo.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ let isArtificial = 1 in {
181181
}
182182
}
183183

184+
let CoveredBySubRegs = 1 in {
184185
// Vector registers
185186
foreach Index = 0-31 in {
186187
def V#Index : VR<!cast<VF>("VF"#Index), !cast<VF>("VFH"#Index), "v"#Index>,
@@ -192,6 +193,7 @@ foreach Index = 0-31 in {
192193
def VSL#Index : VSRL<!cast<FPR>("F"#Index), !cast<FPR>("FH"#Index), "vs"#Index>,
193194
DwarfRegAlias<!cast<FPR>("F"#Index)>;
194195
}
196+
}
195197

196198
// Dummy VSX registers, this defines string: "vs32"-"vs63", and is only used for
197199
// asm printing.

llvm/test/CodeGen/PowerPC/aix-vec_insert_elt.ll

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -750,25 +750,21 @@ entry:
750750
define <2 x double> @testDoubleImm1(<2 x double> %a, double %b) {
751751
; CHECK-64-LABEL: testDoubleImm1:
752752
; CHECK-64: # %bb.0: # %entry
753-
; CHECK-64-NEXT: # kill: def $f1 killed $f1 def $vsl1
754753
; CHECK-64-NEXT: xxpermdi 34, 1, 34, 1
755754
; CHECK-64-NEXT: blr
756755
;
757756
; CHECK-32-LABEL: testDoubleImm1:
758757
; CHECK-32: # %bb.0: # %entry
759-
; CHECK-32-NEXT: # kill: def $f1 killed $f1 def $vsl1
760758
; CHECK-32-NEXT: xxpermdi 34, 1, 34, 1
761759
; CHECK-32-NEXT: blr
762760
;
763761
; CHECK-64-P10-LABEL: testDoubleImm1:
764762
; CHECK-64-P10: # %bb.0: # %entry
765-
; CHECK-64-P10-NEXT: # kill: def $f1 killed $f1 def $vsl1
766763
; CHECK-64-P10-NEXT: xxpermdi 34, 1, 34, 1
767764
; CHECK-64-P10-NEXT: blr
768765
;
769766
; CHECK-32-P10-LABEL: testDoubleImm1:
770767
; CHECK-32-P10: # %bb.0: # %entry
771-
; CHECK-32-P10-NEXT: # kill: def $f1 killed $f1 def $vsl1
772768
; CHECK-32-P10-NEXT: xxpermdi 34, 1, 34, 1
773769
; CHECK-32-P10-NEXT: blr
774770
entry:

0 commit comments

Comments
 (0)