OSDN Git Service

[BDCE] reduce scope of an assert (PR34179)
authorSanjay Patel <spatel@rotateright.com>
Mon, 14 Aug 2017 15:13:46 +0000 (15:13 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 14 Aug 2017 15:13:46 +0000 (15:13 +0000)
commit408158e9c65c6fe46a30a0750e7c8affe4a5d69e
tree8d831969b0785b6c4db99299cfe5b1fcf66df3f1
parentef4534aee526b0ef3563e578644b0092057089fa
[BDCE] reduce scope of an assert (PR34179)

The assert was added with r310779 and is usually correct,
but as the test shows, not always. The 'volatile' on the
load is needed to expose the faulty path because without
it, DemandedBits would return that the load is just dead
rather than not demanded, and so we wouldn't hit the
bogus assert.

Also, since the lambda is just a single-line now, get rid
of it and inline the DB.isAllOnesValue() calls.

This should fix (prevent execution of a faulty assert):
https://bugs.llvm.org/show_bug.cgi?id=34179

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310842 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/BDCE.cpp
test/Transforms/BDCE/invalidate-assumptions.ll