diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/ExecutionDepsFix.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.cpp | 5 | 
2 files changed, 10 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/ExecutionDepsFix.cpp b/llvm/lib/CodeGen/ExecutionDepsFix.cpp index 16a8f921b3d..300f0371211 100644 --- a/llvm/lib/CodeGen/ExecutionDepsFix.cpp +++ b/llvm/lib/CodeGen/ExecutionDepsFix.cpp @@ -600,6 +600,9 @@ void ExeDepsFix::visitSoftInstr(MachineInstr *mi, unsigned mask) {    while (!Regs.empty()) {      if (!dv) {        dv = Regs.pop_back_val().Value; +      // Force the first dv to match the current instruction. +      dv->AvailableDomains = dv->getCommonDomains(available); +      assert(dv->AvailableDomains && "Domain should have been filtered");        continue;      } @@ -617,9 +620,10 @@ void ExeDepsFix::visitSoftInstr(MachineInstr *mi, unsigned mask) {    }    // dv is the DomainValue we are going to use for this instruction. -  if (!dv) +  if (!dv) {      dv = alloc(); -  dv->AvailableDomains = available; +    dv->AvailableDomains = available; +  }    dv->Instrs.push_back(mi);    // Finally set all defs and non-collapsed uses to dv. diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index 4f5b757acd2..24c4a53792d 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -3606,8 +3606,11 @@ void X86InstrInfo::setExecutionDomain(MachineInstr *MI, unsigned Domain) const {    uint16_t dom = (MI->getDesc().TSFlags >> X86II::SSEDomainShift) & 3;    assert(dom && "Not an SSE instruction");    const unsigned *table = lookup(MI->getOpcode(), dom); -  if (!table) // try the other table +  if (!table) { // try the other table +    assert((TM.getSubtarget<X86Subtarget>().hasAVX2() || Domain < 3) && +           "256-bit vector operations only available in AVX2");      table = lookupAVX2(MI->getOpcode(), dom); +  }    assert(table && "Cannot change domain");    MI->setDesc(get(table[Domain-1]));  }  | 

