Skip to content
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Commit ab37a95

Browse files
committed
Revert r268529 because it caused use-of-uninitialized-value
Summary: This reverts commit d88cc08. #0 0xfed467 in llvm::ARMFrameLowering::determineCalleeSaves(llvm::MachineFunction&, llvm::BitVector&, llvm::RegScavenger*) const /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Target/ARM/ARMFrameLowering.cpp:1625:52 #1 0x330d4cc in (anonymous namespace)::PEI::runOnMachineFunction(llvm::MachineFunction&) /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/PrologEpilogInserter.cpp:186:3 #2 0x3193e12 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/CodeGen/MachineFunctionPass.cpp:60:13 #3 0x396237d in llvm::FPPassManager::runOnFunction(llvm::Function&) /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1526:23 #4 0x3962a23 in llvm::FPPassManager::runOnModule(llvm::Module&) /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1547:16 #5 0x3963d52 in runOnModule /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1603:23 #6 0x3963d52 in llvm::legacy::PassManagerImpl::run(llvm::Module&) /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1706 #7 0x6bb910 in compileModule(char**, llvm::LLVMContext&) /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/llc/llc.cpp:412:5 #8 0x6b3c25 in main /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/llc/llc.cpp:218:22 #9 0x7fd4a7d37ec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4) #10 0x625c93 in _start (/mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm_build_msan/bin/llc+0x625c93) Reviewers: Subscribers: git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268536 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent bcfc7d0 commit ab37a95

File tree

2 files changed

+6
-211
lines changed

2 files changed

+6
-211
lines changed

lib/Target/ARM/ARMFrameLowering.cpp

+6-19
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,6 @@ void ARMFrameLowering::determineCalleeSaves(MachineFunction &MF,
14791479
bool CS1Spilled = false;
14801480
bool LRSpilled = false;
14811481
unsigned NumGPRSpills = 0;
1482-
unsigned NumFPRSpills = 0;
14831482
SmallVector<unsigned, 4> UnspilledCS1GPRs;
14841483
SmallVector<unsigned, 4> UnspilledCS2GPRs;
14851484
const ARMBaseRegisterInfo *RegInfo = static_cast<const ARMBaseRegisterInfo *>(
@@ -1534,17 +1533,8 @@ void ARMFrameLowering::determineCalleeSaves(MachineFunction &MF,
15341533
CanEliminateFrame = false;
15351534
}
15361535

1537-
if (!ARM::GPRRegClass.contains(Reg)) {
1538-
if (Spilled) {
1539-
if (ARM::SPRRegClass.contains(Reg))
1540-
NumFPRSpills++;
1541-
else if (ARM::DPRRegClass.contains(Reg))
1542-
NumFPRSpills += 2;
1543-
else if (ARM::QPRRegClass.contains(Reg))
1544-
NumFPRSpills += 4;
1545-
}
1536+
if (!ARM::GPRRegClass.contains(Reg))
15461537
continue;
1547-
}
15481538

15491539
if (Spilled) {
15501540
NumGPRSpills++;
@@ -1617,14 +1607,11 @@ void ARMFrameLowering::determineCalleeSaves(MachineFunction &MF,
16171607
// FIXME: We could add logic to be more precise about negative offsets
16181608
// and which instructions will need a scratch register for them. Is it
16191609
// worth the effort and added fragility?
1620-
auto ArgStackSize = MF.getInfo<ARMFunctionInfo>()->getArgumentStackSize();
1621-
bool BigStack =
1622-
(RS && (MFI->estimateStackSize(MF) + 4 * (NumGPRSpills + NumFPRSpills) +
1623-
(!hasFP(MF) ? ArgStackSize : 0) + 16 /* possible paddings */ +
1624-
((hasFP(MF) && AFI->hasStackFrame()) ? 4 : 0) >=
1625-
estimateRSStackSizeLimit(MF, this))) ||
1626-
MFI->hasVarSizedObjects() ||
1627-
(MFI->adjustsStack() && !canSimplifyCallFramePseudos(MF));
1610+
bool BigStack = (RS && (MFI->estimateStackSize(MF) +
1611+
((hasFP(MF) && AFI->hasStackFrame()) ? 4 : 0) >=
1612+
estimateRSStackSizeLimit(MF, this))) ||
1613+
MFI->hasVarSizedObjects() ||
1614+
(MFI->adjustsStack() && !canSimplifyCallFramePseudos(MF));
16281615

16291616
bool ExtraCSSpill = false;
16301617
if (BigStack || !CanEliminateFrame || RegInfo->cannotEliminateFrame(MF)) {

test/CodeGen/ARM/2016-05-01-RegScavengerAssert.ll

-192
This file was deleted.

0 commit comments

Comments
 (0)