diff options
author | Owen Anderson <resistor@mac.com> | 2008-07-02 23:41:07 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-07-02 23:41:07 +0000 |
commit | f660c171c838793b87b7e58e91609cecf256378d (patch) | |
tree | 00033566da5e0a30f9e67bd56e9a124ccceabfb7 /lib/Target/X86/X86InstrInfo.cpp | |
parent | cd920d9ecfcefff13c3619a32b58399cac2e3630 (diff) | |
download | llvm-f660c171c838793b87b7e58e91609cecf256378d.tar.gz llvm-f660c171c838793b87b7e58e91609cecf256378d.tar.bz2 llvm-f660c171c838793b87b7e58e91609cecf256378d.tar.xz |
Make LiveVariables even more optional, by making it optional in the call to TargetInstrInfo::convertToThreeAddressInstruction
Also, if LV isn't around, then TwoAddr doesn't need to be updating flags, since they won't have been set in the first place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53058 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86InstrInfo.cpp')
-rw-r--r-- | lib/Target/X86/X86InstrInfo.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index 218487e94b..969a05c580 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -978,7 +978,7 @@ static bool hasLiveCondCodeDef(MachineInstr *MI) { MachineInstr * X86InstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI, MachineBasicBlock::iterator &MBBI, - LiveVariables &LV) const { + LiveVariables *LV) const { MachineInstr *MI = MBBI; // All instructions input are two-addr instructions. Get the known operands. unsigned Dest = MI->getOperand(0).getReg(); @@ -1066,10 +1066,12 @@ X86InstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI, MFI->insert(MBBI, Undef); MFI->insert(MBBI, Ins); // Insert the insert_subreg - LV.instructionChanged(MI, NewMI); // Update live variables - LV.addVirtualRegisterKilled(leaInReg, NewMI); + if (LV) { + LV->instructionChanged(MI, NewMI); // Update live variables + LV->addVirtualRegisterKilled(leaInReg, NewMI); + } MFI->insert(MBBI, NewMI); // Insert the new inst - LV.addVirtualRegisterKilled(leaOutReg, Ext); + if (LV) LV->addVirtualRegisterKilled(leaOutReg, Ext); MFI->insert(MBBI, Ext); // Insert the extract_subreg return Ext; } else { @@ -1180,7 +1182,7 @@ X86InstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI, if (!NewMI) return 0; NewMI->copyKillDeadInfo(MI); - LV.instructionChanged(MI, NewMI); // Update live variables + if (LV) LV->instructionChanged(MI, NewMI); // Update live variables MFI->insert(MBBI, NewMI); // Insert the new inst return NewMI; } |