[PATCH] D55563: [BDCE][DemandedBits] Detect dead uses of undead instructions
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 31 07:00:48 PST 2018
nikic updated this revision to Diff 179760.
nikic added a comment.
Fix removal of dead uses. The previous version had a check whether the previous demanded bits are empty and only dropped the use from the DeadUses set in that case. The motivation for this was that the use could only be part of DeadUses if the demanded bits are empty, so we can save a redundant hash lookup. Of course, this is not actually true, because the previous demanded bits are for the instruction across all users, which is a superset of the demanded bits for a single use. (That being kind of the whole point of this change, I'm really not sure what I was thinking there...)
So now I'm just always doing the erase() call when a use has non-empty demanded bits. I've also added a testcase that was miscompiled with the previous version. I believe that this is also what caused the failure in enc-3des from the test-suite.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55563/new/
https://reviews.llvm.org/D55563
Files:
include/llvm/Analysis/DemandedBits.h
lib/Analysis/DemandedBits.cpp
lib/Transforms/Scalar/BDCE.cpp
test/Transforms/BDCE/dead-uses.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55563.179760.patch
Type: text/x-patch
Size: 7590 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181231/1c2686ff/attachment.bin>
More information about the llvm-commits
mailing list