llvm.org GIT mirror llvm / d574bb5
Fix a bug where we were counting the alias sets as completely used registers for fast allocation a different way. This has us updating used registers only when we're using that exact register. Fixes rdar://9207598 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129711 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 9 years ago
2 changed file(s) with 15 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
395395 PhysRegState[PhysReg] = NewState;
396396 for (const unsigned *AS = TRI->getAliasSet(PhysReg);
397397 unsigned Alias = *AS; ++AS) {
398 UsedInInstr.set(Alias);
399398 switch (unsigned VirtReg = PhysRegState[Alias]) {
400399 case regDisabled:
401400 break;
733732 if (!Reg || !TargetRegisterInfo::isPhysicalRegister(Reg)) continue;
734733 DEBUG(dbgs() << "\tSetting reg " << Reg << " as used in instr\n");
735734 UsedInInstr.set(Reg);
736 for (const unsigned *AS = TRI->getAliasSet(Reg); *AS; ++AS) {
737 DEBUG(dbgs() << "\tSetting alias reg " << *AS << " as used in instr\n");
738 UsedInInstr.set(*AS);
739 }
740735 }
741736
742737 // Also mark PartialDefs as used to avoid reallocation.
0 ; RUN: llc < %s -O0 -verify-machineinstrs -regalloc=fast
1 ; Previously we'd crash as out of registers on this input by clobbering all of
2 ; the aliases.
3 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:64-v128:32:128-a0:0:32-n32"
4 target triple = "thumbv7-apple-darwin10.0.0"
5
6 define void @_Z8TestCasev() nounwind ssp {
7 entry:
8 %a = alloca float, align 4
9 %tmp = load float* %a, align 4
10 call void asm sideeffect "", "w,~{s0},~{s16}"(float %tmp) nounwind, !srcloc !0
11 ret void
12 }
13
14 !0 = metadata !{i32 109}