Our internal test passes---thank you for the fix.
Oct 26 2020
Jun 19 2020
Ah, I missed your comment. I'll pull your fix and retest.
Return true to trigger the simplifier.
Thanks for the consensus. New patch uploaded.
Jun 18 2020
Good clarification: InstCombine vs. InstSimplify.
Merged and reduced test, full diff included.
If the patch is OK, could I ask you one more favor: to commit it? I do not have commit access to the project.
Updated to run InstCombine before the vector transformations. The insert-binop-with-constant test needed a few changes. InstructionSimplify checks for constant divisors with 0/undef elements and undef's the entire result.
Jun 17 2020
If running IC is cheap, that's a good solution. I will put up another patch. Thanks.
The IR looks strange, but it's unfortunately showing up in a few real test cases in our LLVM branch, after we've made some mods to the unroller and vectorizer.
FWIW, dropping the attribute LGTM. The heap/stack promotion is still a work in progress, is that correct? At least, I don't see it happening in trunk.
Oct 8 2019
Restoring latest patch.
Jan 19 2019
@mkazantsev, would you mind taking one more look at this patch? One significant fix was made since your last review, to handle duplicate edges from SwitchInsts. The patch has now been rebased to latest (which hasn't changed it much). Thanks!
Nov 20 2018
Did not include the reverted part of the code (the important part :) ) in the new patch. Added separate testcase for switch-backedge. Thanks for the fix suggestions.
Nov 16 2018
Keep the InLoopPredecessors vector in the original order.
Missed the sort call -- thanks.
Remove duplicate blocks from the list of exit predecessors. This happens when the predecessor inst is a switch with duplicate targets. Avoids block double-processing and maintains the metadata consistency assertion.
Nov 14 2018
Sorry for the trouble. I'll figure out what happened.
Nov 6 2018
Thank you for the thorough review. I have one more request to the reviewers on this list: could someone give a hand to commit the code? I don't have write access to the repo yet.
Nov 2 2018
Previous patch was null, this is the right one.
Rewrote comments, fixed formatting, simplified test and added checks for specific metadata
Oct 30 2018
Oct 26 2018
One more favor to ask: Could I please have some help committing this fix? I'm new to the project and don't have write access yet...
Thanks! I've made the suggested test change.