Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Transforms/Scalar/BDCE.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | |||||
continue; | continue; | ||||
// Remove instructions that are dead, either because they were not reached | // Remove instructions that are dead, either because they were not reached | ||||
// during analysis or have no demanded bits. | // during analysis or have no demanded bits. | ||||
if (DB.isInstructionDead(&I) || | if (DB.isInstructionDead(&I) || | ||||
(I.getType()->isIntOrIntVectorTy() && | (I.getType()->isIntOrIntVectorTy() && | ||||
DB.getDemandedBits(&I).isNullValue() && | DB.getDemandedBits(&I).isNullValue() && | ||||
wouldInstructionBeTriviallyDead(&I))) { | wouldInstructionBeTriviallyDead(&I))) { | ||||
salvageDebugInfoOrMarkUndef(I); | salvageDebugInfo(I); | ||||
Worklist.push_back(&I); | Worklist.push_back(&I); | ||||
I.dropAllReferences(); | I.dropAllReferences(); | ||||
Changed = true; | Changed = true; | ||||
continue; | continue; | ||||
} | } | ||||
for (Use &U : I.operands()) { | for (Use &U : I.operands()) { | ||||
// DemandedBits only detects dead integer uses. | // DemandedBits only detects dead integer uses. | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |