diff options
author | Craig Topper <craig.topper@intel.com> | 2018-07-14 06:30:30 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-07-14 06:30:30 +0000 |
commit | 7426cf6717c341717f852142d8d11e81f0d67590 (patch) | |
tree | 8eee1a580d50028e2d4e353710b1c03ec4d33f31 /llvm/lib | |
parent | d8098f979906c458406fab4ab0773e350cb294a6 (diff) | |
download | bcm5719-llvm-7426cf6717c341717f852142d8d11e81f0d67590.tar.gz bcm5719-llvm-7426cf6717c341717f852142d8d11e81f0d67590.zip |
[X86] Fix a subtle bug in the custom execution domain fixing for blends.
The code tried to find the immediate by using getNumOperands() on the MachineInstr, but there might be implicit-defs after the immediate that get counted.
Instead use getNumOperands() from the instruction description which will only count the operands that are defined in the td file.
llvm-svn: 337088
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index c6f679a3c6b..1576d901afe 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -6365,7 +6365,7 @@ static bool AdjustBlendMask(unsigned OldMask, unsigned OldWidth, uint16_t X86InstrInfo::getExecutionDomainCustom(const MachineInstr &MI) const { unsigned Opcode = MI.getOpcode(); - unsigned NumOperands = MI.getNumOperands(); + unsigned NumOperands = MI.getDesc().getNumOperands(); auto GetBlendDomains = [&](unsigned ImmWidth, bool Is256) { uint16_t validDomains = 0; @@ -6421,7 +6421,7 @@ bool X86InstrInfo::setExecutionDomainCustom(MachineInstr &MI, assert(dom && "Not an SSE instruction"); unsigned Opcode = MI.getOpcode(); - unsigned NumOperands = MI.getNumOperands(); + unsigned NumOperands = MI.getDesc().getNumOperands(); auto SetBlendDomain = [&](unsigned ImmWidth, bool Is256) { if (MI.getOperand(NumOperands - 1).isImm()) { |