The logic at the end of TailDuplicate seems dead - can we remove it?

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 4 11:59:35 PDT 2016


David Blaikie <dblaikie at gmail.com> writes:
> If you want to be defensive, youc ould turn the whole loop into an
> assert(any_of(...)) - that way we'll find it if the situation comes up for
> anyone doing a +Asserts build, and we can get a test case and from
> there/decide if we need the functionality, etc.

The assert ends up being a bit intense. Patch attached. Do you think
it's worth it? If not I'll just do the removal by itself.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tail-dup-dead-code-assert.patch
Type: text/x-patch
Size: 5378 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160404/4a33016d/attachment.bin>
-------------- next part --------------


> On Thu, Mar 31, 2016 at 11:31 AM, Justin Bogner via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> There's some code near the end of TailDuplicate to handle "the nasty
>> case in that we duplicated a block that is part of a loop into some but
>> not all of its predecessors."
>>
>> I noticed that this isn't covered by our existing tests and spent some
>> time trying to come up with an example it actually hits. I tried hand
>> rolling something based on the explanation in the comment, but couldn't
>> get anything that didn't abort tail duplication earlier for one reason
>> or another.
>>
>> Then, I applied the attached patch (with tail-dup-size cranked up so
>> this would fire more) and ran a bootstrap of clang and the nightly test
>> suite - the assert was never hit.
>>
>> I suspect that things have changed and the situation this code handles
>> can't happen anymore. Should we remove it?
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>>


More information about the llvm-commits mailing list