AMDGPU: Simplify VOP3 operand legalization.
[oota-llvm.git] / lib / Target / AMDGPU / SIISelLowering.cpp
index 0d11f3b6847f01b53b468ea14751728cd439de55..c9bc352703cf2fd064f41a075f375340b3538a16 100644 (file)
@@ -2144,7 +2144,12 @@ void SITargetLowering::AdjustInstrPostInstrSelection(MachineInstr *MI,
       static_cast<const SIInstrInfo *>(Subtarget->getInstrInfo());
 
   MachineRegisterInfo &MRI = MI->getParent()->getParent()->getRegInfo();
-  TII->legalizeOperands(MI);
+
+  if (TII->isVOP3(MI->getOpcode())) {
+    // Make sure constant bus requirements are respected.
+    TII->legalizeOperandsVOP3(MRI, MI);
+    return;
+  }
 
   if (TII->isMIMG(*MI)) {
     unsigned VReg = MI->getOperand(0).getReg();