[llvm] r314180 - [AVR] When lowering shifts into loops, put newly generated MBBs in the same

Dylan McKay via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 18:40:01 PDT 2017


Done in r314182, thanks for the feedback

On Tue, Sep 26, 2017 at 2:01 PM, Friedman, Eli <efriedma at codeaurora.org>
wrote:

> On 9/25/2017 5:51 PM, Dylan McKay via llvm-commits wrote:
>
>> Author: dylanmckay
>> Date: Mon Sep 25 17:51:03 2017
>> New Revision: 314180
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=314180&view=rev
>> Log:
>> [AVR] When lowering shifts into loops, put newly generated MBBs in the
>> same
>> spot as the original MBB
>>
>> Discovered in avr-rust/rust#62
>> https://github.com/avr-rust/rust/issues/62
>>
>> Patch by Gergo Erdi.
>>
>> Modified:
>>      llvm/trunk/lib/Target/AVR/AVRISelLowering.cpp
>>
>> Modified: llvm/trunk/lib/Target/AVR/AVRISelLowering.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AV
>> R/AVRISelLowering.cpp?rev=314180&r1=314179&r2=314180&view=diff
>> ============================================================
>> ==================
>> --- llvm/trunk/lib/Target/AVR/AVRISelLowering.cpp (original)
>> +++ llvm/trunk/lib/Target/AVR/AVRISelLowering.cpp Mon Sep 25 17:51:03
>> 2017
>> @@ -1469,8 +1469,10 @@ MachineBasicBlock *AVRTargetLowering::in
>>     }
>>       const BasicBlock *LLVM_BB = BB->getBasicBlock();
>> -  MachineFunction::iterator I = BB->getParent()->begin();
>> -  ++I;
>> +
>> +  MachineFunction::iterator I;
>> +  for (I = F->begin(); I != F->end() && &(*I) != BB; ++I);
>> +  if (I != F->end()) ++I;
>>
>>
>
> You can convert a MachineBasicBlock* to a MachineFunction::iterator by
> calling "BB->getIterator()".
>
> -Eli
>
> --
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
> Foundation Collaborative Project
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170926/0a7df86c/attachment.html>


More information about the llvm-commits mailing list