[PATCH] D11596: Separate out BDCE's analysis into a separate DemandedBits analysis.

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 09:43:32 PDT 2015


jmolloy updated this revision to Diff 31950.
jmolloy added a comment.

Hi Hal,

I've updated the diff with most of your comments updated, however:

> Is looks like, as you have it setup, getDemandedBits will return all ones for an instruction not in the map (for any instruction for which DB.demandedBitsKnown(&I) would return false). As a result, we don't need the DB.demandedBitsKnown(&I) check and can just use the DB.getDemandedBits check (avoiding repeating the map lookup).


Unfortunately this isn't the case. BDCE expects to handle the case where an instruction was analyzed, but has bits demanded differently to an instruction that wasn't even analyzed. In the second case it expects to dive off down the else path, in the first case it doesn't. Changing that behavior at all leads to lots of use-before-free asserts.

James


Repository:
  rL LLVM

http://reviews.llvm.org/D11596

Files:
  include/llvm/Analysis/DemandedBits.h
  include/llvm/InitializePasses.h
  lib/Analysis/Analysis.cpp
  lib/Analysis/CMakeLists.txt
  lib/Analysis/DemandedBits.cpp
  lib/Transforms/Scalar/BDCE.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11596.31950.patch
Type: text/x-patch
Size: 31220 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150812/05ab3b6b/attachment.bin>


More information about the llvm-commits mailing list