Revert "[instcombine] Exploit UB implied by nofree attributes"
authorPhilip Reames <listmail@philipreames.com>
Thu, 22 Apr 2021 17:47:41 +0000 (10:47 -0700)
committerPhilip Reames <listmail@philipreames.com>
Thu, 22 Apr 2021 17:53:17 +0000 (10:53 -0700)
commit15e19a259986ebb993a719b960b6bd3bb28d8329
treec76bb822bb7fb917de272bad3a45861e1d584e3e
parente01c419ecdf5511c550c3ec9d9c9dd132b480e88
Revert "[instcombine] Exploit UB implied by nofree attributes"

This change effectively reverts 86664638, but since there have been some changes on top and I wanted to leave the tests in, it's not a mechanical revert.

Why revert this now?  Two main reasons:
1) There are continuing discussion around what the semantics of nofree.  I am getting increasing uncomfortable with the seeming possibility we might redefine nofree in a way incompatible with these changes.
2) There was a reported miscompile triggered by this change (https://github.com/emscripten-core/emscripten/issues/9443).  At first, I was making good progress on tracking down the issues exposed and those issues appeared to be unrelated latent bugs.  Now that we've found at least one bug in the original change, and the investigation has stalled, I'm no longer comfortable leaving this in tree.  In retrospect, I probably should have reverted this earlier and investigated the issues once the triggering change was out of tree.
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/malloc-free-delete.ll