[llvm-commits] [llvm] r99485 - in /llvm/trunk: lib/CodeGen/SelectionDAG/InstrEmitter.cpp test/CodeGen/X86/2007-01-13-StackPtrIndex.ll test/CodeGen/X86/2009-02-26-MachineLICMBug.ll test/CodeGen/X86/coalesce-esp.ll test/CodeGen/X86/licm-symbol.ll test/CodeGen/X86/phys_subreg_coalesce-2.ll test/CodeGen/X86/pr2659.ll

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Mar 25 08:05:31 PDT 2010


On Mar 24, 2010, at 10:40 PM, Chris Lattner wrote:

> Author: lattner
> Date: Thu Mar 25 00:40:48 2010
> New Revision: 99485
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=99485&view=rev
> Log:
> Make the NDEBUG assertion stronger and more clear what is 
> happening.
> 
> Enhance scheduling to set the DEAD flag on implicit defs
> more aggressively.  Before, we'd set an implicit def operand
> to dead if it were present in the SDNode corresponding to
> the machineinstr but had no use.  Now we do it in this case
> AND if the implicit def does not exist in the SDNode at all.

This patch seems to be upsetting the valgrind testers:

==1772== Invalid read of size 1
==1772==    at 0x85C9B7C: llvm::MachineOperand::isReg() const (MachineOperand.h:152)
==1772==    by 0x8A32FBD: llvm::MachineInstr::addRegisterDead(unsigned int, llvm::TargetRegisterInfo const*, bool) (MachineInstr.cpp:1307)
==1772==    by 0x896459E: llvm::InstrEmitter::EmitMachineNode(llvm::SDNode*, bool, bool, llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo<llvm::SDValue>, llvm::DenseMapInfo<unsigned int> >&, llvm::DenseMap<llvm::MachineBasicBlock*, llvm::MachineBasicBlock*, llvm::DenseMapInfo<llvm::MachineBasicBlock*>, llvm::DenseMapInfo<llvm::MachineBasicBlock*> >*) (InstrEmitter.cpp:648)
==1772==    by 0x88C8AD2: llvm::InstrEmitter::EmitNode(llvm::SDNode*, bool, bool, llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo<llvm::SDValue>, llvm::DenseMapInfo<unsigned int> >&, llvm::DenseMap<llvm::MachineBasicBlock*, llvm::MachineBasicBlock*, llvm::DenseMapInfo<llvm::MachineBasicBlock*>, llvm::DenseMapInfo<llvm::MachineBasicBlock*> >*) (InstrEmitter.h:116)
==1772==    by 0x88C7743: llvm::ScheduleDAGSDNodes::EmitSchedule(llvm::DenseMap<llvm::MachineBasicBlock*, llvm::MachineBasicBlock*, llvm::DenseMapInfo<llvm::MachineBasicBlock*>, llvm::DenseMapInfo<llvm::MachineBasicBlock*> >*) (ScheduleDAGSDNodes.cpp:501)
==1772==    by 0x893ACF2: llvm::SelectionDAGISel::CodeGenAndEmitDAG() (SelectionDAGISel.cpp:776)
==1772==    by 0x8938D04: llvm::SelectionDAGISel::SelectBasicBlock(llvm::BasicBlock*, llvm::ilist_iterator<llvm::Instruction>, llvm::ilist_iterator<llvm::Instruction>, bool&) (SelectionDAGISel.cpp:437)
==1772==    by 0x893BA65: llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function&, llvm::MachineFunction&, llvm::MachineModuleInfo*, llvm::DwarfWriter*, llvm::TargetInstrInfo const&) (SelectionDAGISel.cpp:1030)
==1772==    by 0x89387E9: llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (SelectionDAGISel.cpp:344)
==1772==    by 0x8A2D58A: llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (MachineFunctionPass.cpp:27)
==1772==    by 0x8D30AD0: llvm::FPPassManager::runOnFunction(llvm::Function&) (PassManager.cpp:1350)
==1772==    by 0x8D3080F: llvm::FunctionPassManagerImpl::run(llvm::Function&) (PassManager.cpp:1301)
==1772==  Address 0x7aeeb38 is 0 bytes inside a block of size 120 free'd
==1772==    at 0x779F57D: operator delete(void*) (vg_replace_malloc.c:346)
==1772==    by 0x87136C8: __gnu_cxx::new_allocator<llvm::MachineOperand>::deallocate(llvm::MachineOperand*, unsigned int) (new_allocator.h:95)
==1772==    by 0x871339E: std::_Vector_base<llvm::MachineOperand, std::allocator<llvm::MachineOperand> >::_M_deallocate(llvm::MachineOperand*, unsigned int) (stl_vector.h:146)
==1772==    by 0x8A04AD3: std::_Vector_base<llvm::MachineOperand, std::allocator<llvm::MachineOperand> >::~_Vector_base() (stl_vector.h:132)
==1772==    by 0x8A04272: std::vector<llvm::MachineOperand, std::allocator<llvm::MachineOperand> >::~vector() (stl_vector.h:313)
==1772==    by 0x8A305B9: llvm::MachineInstr::~MachineInstr() (MachineInstr.cpp:521)
==1772==    by 0x8A26296: llvm::MachineFunction::DeleteMachineInstr(llvm::MachineInstr*) (MachineFunction.cpp:203)
==1772==    by 0x8818DC7: llvm::X86TargetLowering::EmitLoweredSelect(llvm::MachineInstr*, llvm::MachineBasicBlock*, llvm::DenseMap<llvm::MachineBasicBlock*, llvm::MachineBasicBlock*, llvm::DenseMapInfo<llvm::MachineBasicBlock*>, llvm::DenseMapInfo<llvm::MachineBasicBlock*> >*) const (X86ISelLowering.cpp:8490)
==1772==    by 0x881923B: llvm::X86TargetLowering::EmitInstrWithCustomInserter(llvm::MachineInstr*, llvm::MachineBasicBlock*, llvm::DenseMap<llvm::MachineBasicBlock*, llvm::MachineBasicBlock*, llvm::DenseMapInfo<llvm::MachineBasicBlock*>, llvm::DenseMapInfo<llvm::MachineBasicBlock*> >*) const (X86ISelLowering.cpp:8538)
==1772==    by 0x896432C: llvm::InstrEmitter::EmitMachineNode(llvm::SDNode*, bool, bool, llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo<llvm::SDValue>, llvm::DenseMapInfo<unsigned int> >&, llvm::DenseMap<llvm::MachineBasicBlock*, llvm::MachineBasicBlock*, llvm::DenseMapInfo<llvm::MachineBasicBlock*>, llvm::DenseMapInfo<llvm::MachineBasicBlock*> >*) (InstrEmitter.cpp:618)
==1772==    by 0x88C8AD2: llvm::InstrEmitter::EmitNode(llvm::SDNode*, bool, bool, llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo<llvm::SDValue>, llvm::DenseMapInfo<unsigned int> >&, llvm::DenseMap<llvm::MachineBasicBlock*, llvm::MachineBasicBlock*, llvm::DenseMapInfo<llvm::MachineBasicBlock*>, llvm::DenseMapInfo<llvm::MachineBasicBlock*> >*) (InstrEmitter.h:116)
==1772==    by 0x88C7743: llvm::ScheduleDAGSDNodes::EmitSchedule(llvm::DenseMap<llvm::MachineBasicBlock*, llvm::MachineBasicBlock*, llvm::DenseMapInfo<llvm::MachineBasicBlock*>, llvm::DenseMapInfo<llvm::MachineBasicBlock*> >*) (ScheduleDAGSDNodes.cpp:501)







More information about the llvm-commits mailing list