zvi added a comment. Ayman, I think that @mkuper 's observation is the way to fix the PR you are addressing, followed by patches for the optimization in this patch, and @andreadb's suggestions. https://reviews.llvm.org/D27573