]> granicus.if.org Git - llvm/commitdiff
[AMDGPU] Add exec copy to LiveIntervals in SILowerControlFlow::emitElse
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Thu, 19 Jan 2017 21:26:22 +0000 (21:26 +0000)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Thu, 19 Jan 2017 21:26:22 +0000 (21:26 +0000)
This instruction is missing from LiveIntervals.
I'm not aware of any problems because of this though.

Differential Revision: https://reviews.llvm.org/D28879

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292521 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AMDGPU/SILowerControlFlow.cpp

index 4a7dff44dfc9d017764834029e54adf33f01c3e1..0a0faf36c22c4e57a92814ac60355d38c535018b 100644 (file)
@@ -219,7 +219,8 @@ void SILowerControlFlow::emitElse(MachineInstr &MI) {
   // tied. In order to correctly tie the registers, split this into a copy of
   // the src like it does.
   unsigned CopyReg = MRI->createVirtualRegister(&AMDGPU::SReg_64RegClass);
-  BuildMI(MBB, Start, DL, TII->get(AMDGPU::COPY), CopyReg)
+  MachineInstr *CopyExec =
+    BuildMI(MBB, Start, DL, TII->get(AMDGPU::COPY), CopyReg)
       .add(MI.getOperand(1)); // Saved EXEC
 
   // This must be inserted before phis and any spill code inserted before the
@@ -261,6 +262,7 @@ void SILowerControlFlow::emitElse(MachineInstr &MI) {
   LIS->RemoveMachineInstrFromMaps(MI);
   MI.eraseFromParent();
 
+  LIS->InsertMachineInstrInMaps(*CopyExec);
   LIS->InsertMachineInstrInMaps(*OrSaveExec);
 
   LIS->InsertMachineInstrInMaps(*Xor);