mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
No need to look through bitcasts for DbgInfoIntrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94112 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -406,12 +406,8 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) {
|
|||||||
for (unsigned ScanInsts = 6; BBI != SI.getParent()->begin() && ScanInsts;
|
for (unsigned ScanInsts = 6; BBI != SI.getParent()->begin() && ScanInsts;
|
||||||
--ScanInsts) {
|
--ScanInsts) {
|
||||||
--BBI;
|
--BBI;
|
||||||
// Don't count debug info directives, lest they affect codegen,
|
// Don't count debug info directives, lest they affect codegen
|
||||||
// and we skip pointer-to-pointer bitcasts, which are NOPs.
|
if (isa<DbgInfoIntrinsic>(BBI)) {
|
||||||
// It is necessary for correctness to skip those that feed into a
|
|
||||||
// llvm.dbg.declare, as these are not present when debugging is off.
|
|
||||||
if (isa<DbgInfoIntrinsic>(BBI) ||
|
|
||||||
(isa<BitCastInst>(BBI) && isa<PointerType>(BBI->getType()))) {
|
|
||||||
ScanInsts++;
|
ScanInsts++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -475,14 +471,12 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) {
|
|||||||
|
|
||||||
|
|
||||||
// If this store is the last instruction in the basic block (possibly
|
// If this store is the last instruction in the basic block (possibly
|
||||||
// excepting debug info instructions and the pointer bitcasts that feed
|
// excepting debug info instructions), and if the block ends with an
|
||||||
// into them), and if the block ends with an unconditional branch, try
|
// unconditional branch, try to move it to the successor block.
|
||||||
// to move it to the successor block.
|
|
||||||
BBI = &SI;
|
BBI = &SI;
|
||||||
do {
|
do {
|
||||||
++BBI;
|
++BBI;
|
||||||
} while (isa<DbgInfoIntrinsic>(BBI) ||
|
} while (isa<DbgInfoIntrinsic>(BBI));
|
||||||
(isa<BitCastInst>(BBI) && isa<PointerType>(BBI->getType())));
|
|
||||||
if (BranchInst *BI = dyn_cast<BranchInst>(BBI))
|
if (BranchInst *BI = dyn_cast<BranchInst>(BBI))
|
||||||
if (BI->isUnconditional())
|
if (BI->isUnconditional())
|
||||||
if (SimplifyStoreAtEndOfBlock(SI))
|
if (SimplifyStoreAtEndOfBlock(SI))
|
||||||
@@ -542,8 +536,7 @@ bool InstCombiner::SimplifyStoreAtEndOfBlock(StoreInst &SI) {
|
|||||||
if (OtherBr->isUnconditional()) {
|
if (OtherBr->isUnconditional()) {
|
||||||
--BBI;
|
--BBI;
|
||||||
// Skip over debugging info.
|
// Skip over debugging info.
|
||||||
while (isa<DbgInfoIntrinsic>(BBI) ||
|
while (isa<DbgInfoIntrinsic>(BBI)) {
|
||||||
(isa<BitCastInst>(BBI) && isa<PointerType>(BBI->getType()))) {
|
|
||||||
if (BBI==OtherBB->begin())
|
if (BBI==OtherBB->begin())
|
||||||
return false;
|
return false;
|
||||||
--BBI;
|
--BBI;
|
||||||
|
Reference in New Issue
Block a user