[llvm-commits] [llvm] r108440 - in /llvm/trunk/lib/CodeGen: AggressiveAntiDepBreaker.cpp AggressiveAntiDepBreaker.h
Chris Lattner
clattner at apple.com
Thu Jul 15 13:16:27 PDT 2010
works for me, thanks.
On Jul 15, 2010, at 1:08 PM, Bill Wendling wrote:
> They need to be initialized. They shouldn't need resizing. :)
>
> -bw
>
> On Jul 15, 2010, at 12:51 PM, Chris Lattner wrote:
>
>> Doesn't something need to resize these?
>>
>> -Chris
>>
>> On Jul 15, 2010, at 11:43 AM, Bill Wendling wrote:
>>
>>> Author: void
>>> Date: Thu Jul 15 13:43:09 2010
>>> New Revision: 108440
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=108440&view=rev
>>> Log:
>>> Use std::vector instead of TargetRegisterInfo::FirstVirtualRegister.
>>>
>>> Modified:
>>> llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp
>>> llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.h
>>>
>>> Modified: llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp?rev=108440&r1=108439&r2=108440&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp (original)
>>> +++ llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp Thu Jul 15 13:43:09 2010
>>> @@ -145,8 +145,8 @@
>>> State = new AggressiveAntiDepState(TRI->getNumRegs(), BB);
>>>
>>> bool IsReturnBlock = (!BB->empty() && BB->back().getDesc().isReturn());
>>> - unsigned *KillIndices = State->GetKillIndices();
>>> - unsigned *DefIndices = State->GetDefIndices();
>>> + std::vector<unsigned> &KillIndices = State->GetKillIndices();
>>> + std::vector<unsigned> &DefIndices = State->GetDefIndices();
>>>
>>> // Determine the live-out physregs for this block.
>>> if (IsReturnBlock) {
>>> @@ -226,7 +226,7 @@
>>> DEBUG(MI->dump());
>>> DEBUG(dbgs() << "\tRegs:");
>>>
>>> - unsigned *DefIndices = State->GetDefIndices();
>>> + std::vector<unsigned> &DefIndices = State->GetDefIndices();
>>> for (unsigned Reg = 0; Reg != TRI->getNumRegs(); ++Reg) {
>>> // If Reg is current live, then mark that it can't be renamed as
>>> // we don't know the extent of its live-range anymore (now that it
>>> @@ -328,8 +328,8 @@
>>> const char *tag,
>>> const char *header,
>>> const char *footer) {
>>> - unsigned *KillIndices = State->GetKillIndices();
>>> - unsigned *DefIndices = State->GetDefIndices();
>>> + std::vector<unsigned> &KillIndices = State->GetKillIndices();
>>> + std::vector<unsigned> &DefIndices = State->GetDefIndices();
>>> std::multimap<unsigned, AggressiveAntiDepState::RegisterReference>&
>>> RegRefs = State->GetRegRefs();
>>>
>>> @@ -364,7 +364,7 @@
>>> void AggressiveAntiDepBreaker::PrescanInstruction(MachineInstr *MI,
>>> unsigned Count,
>>> std::set<unsigned>& PassthruRegs) {
>>> - unsigned *DefIndices = State->GetDefIndices();
>>> + std::vector<unsigned> &DefIndices = State->GetDefIndices();
>>> std::multimap<unsigned, AggressiveAntiDepState::RegisterReference>&
>>> RegRefs = State->GetRegRefs();
>>>
>>> @@ -560,8 +560,8 @@
>>> unsigned AntiDepGroupIndex,
>>> RenameOrderType& RenameOrder,
>>> std::map<unsigned, unsigned> &RenameMap) {
>>> - unsigned *KillIndices = State->GetKillIndices();
>>> - unsigned *DefIndices = State->GetDefIndices();
>>> + std::vector<unsigned> &KillIndices = State->GetKillIndices();
>>> + std::vector<unsigned> &DefIndices = State->GetDefIndices();
>>> std::multimap<unsigned, AggressiveAntiDepState::RegisterReference>&
>>> RegRefs = State->GetRegRefs();
>>>
>>> @@ -733,8 +733,8 @@
>>> MachineBasicBlock::iterator Begin,
>>> MachineBasicBlock::iterator End,
>>> unsigned InsertPosIndex) {
>>> - unsigned *KillIndices = State->GetKillIndices();
>>> - unsigned *DefIndices = State->GetDefIndices();
>>> + std::vector<unsigned> &KillIndices = State->GetKillIndices();
>>> + std::vector<unsigned> &DefIndices = State->GetDefIndices();
>>> std::multimap<unsigned, AggressiveAntiDepState::RegisterReference>&
>>> RegRefs = State->GetRegRefs();
>>>
>>>
>>> Modified: llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.h
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.h?rev=108440&r1=108439&r2=108440&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.h (original)
>>> +++ llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.h Thu Jul 15 13:43:09 2010
>>> @@ -66,20 +66,20 @@
>>>
>>> /// KillIndices - The index of the most recent kill (proceding bottom-up),
>>> /// or ~0u if the register is not live.
>>> - unsigned KillIndices[TargetRegisterInfo::FirstVirtualRegister];
>>> + std::vector<unsigned> KillIndices;
>>>
>>> /// DefIndices - The index of the most recent complete def (proceding bottom
>>> /// up), or ~0u if the register is live.
>>> - unsigned DefIndices[TargetRegisterInfo::FirstVirtualRegister];
>>> + std::vector<unsigned> DefIndices;
>>>
>>> public:
>>> AggressiveAntiDepState(const unsigned TargetRegs, MachineBasicBlock *BB);
>>>
>>> /// GetKillIndices - Return the kill indices.
>>> - unsigned *GetKillIndices() { return KillIndices; }
>>> + std::vector<unsigned> &GetKillIndices() { return KillIndices; }
>>>
>>> /// GetDefIndices - Return the define indices.
>>> - unsigned *GetDefIndices() { return DefIndices; }
>>> + std::vector<unsigned> &GetDefIndices() { return DefIndices; }
>>>
>>> /// GetRegRefs - Return the RegRefs map.
>>> std::multimap<unsigned, RegisterReference>& GetRegRefs() { return RegRefs; }
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list