Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | bool InstCombiner::SimplifyDemandedBits(Instruction *I, unsigned OpNo, | ||||
const APInt &DemandedMask, | const APInt &DemandedMask, | ||||
KnownBits &Known, | KnownBits &Known, | ||||
unsigned Depth) { | unsigned Depth) { | ||||
Use &U = I->getOperandUse(OpNo); | Use &U = I->getOperandUse(OpNo); | ||||
Value *NewVal = SimplifyDemandedUseBits(U.get(), DemandedMask, Known, | Value *NewVal = SimplifyDemandedUseBits(U.get(), DemandedMask, Known, | ||||
Depth, I); | Depth, I); | ||||
if (!NewVal) return false; | if (!NewVal) return false; | ||||
if (Instruction* OpInst = dyn_cast<Instruction>(U)) | if (Instruction* OpInst = dyn_cast<Instruction>(U)) | ||||
salvageDebugInfoOrMarkUndef(*OpInst); | salvageDebugInfo(*OpInst); | ||||
replaceUse(U, NewVal); | replaceUse(U, NewVal); | ||||
return true; | return true; | ||||
} | } | ||||
/// This function attempts to replace V with a simpler value based on the | /// This function attempts to replace V with a simpler value based on the | ||||
/// demanded bits. When this function is called, it is known that only the bits | /// demanded bits. When this function is called, it is known that only the bits | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |