mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
Don't count DebugInfo instructions in another limit
(lest they affect codegen). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65915 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -11439,12 +11439,18 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) {
|
|||||||
SI.getAlignment()))
|
SI.getAlignment()))
|
||||||
SI.setAlignment(KnownAlign);
|
SI.setAlignment(KnownAlign);
|
||||||
|
|
||||||
// Do really simple DSE, to catch cases where there are several consequtive
|
// Do really simple DSE, to catch cases where there are several consecutive
|
||||||
// stores to the same location, separated by a few arithmetic operations. This
|
// stores to the same location, separated by a few arithmetic operations. This
|
||||||
// situation often occurs with bitfield accesses.
|
// situation often occurs with bitfield accesses.
|
||||||
BasicBlock::iterator BBI = &SI;
|
BasicBlock::iterator BBI = &SI;
|
||||||
for (unsigned ScanInsts = 6; BBI != SI.getParent()->begin() && ScanInsts;
|
for (unsigned ScanInsts = 6; BBI != SI.getParent()->begin() && ScanInsts;
|
||||||
--ScanInsts) {
|
--ScanInsts) {
|
||||||
|
// Don't count debug info directives, lest they affect codegen.
|
||||||
|
if (isa<DbgInfoIntrinsic>(BBI)) {
|
||||||
|
ScanInsts++;
|
||||||
|
--BBI;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
--BBI;
|
--BBI;
|
||||||
|
|
||||||
if (StoreInst *PrevSI = dyn_cast<StoreInst>(BBI)) {
|
if (StoreInst *PrevSI = dyn_cast<StoreInst>(BBI)) {
|
||||||
|
Reference in New Issue
Block a user