diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-10-21 11:55:56 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-10-21 11:55:56 +0000 |
| commit | abc24fdb943f5b188c4b362551167d5cbe5de527 (patch) | |
| tree | 5eff0d73102b6d0d8cd65718d4ab435fefad671b /llvm/lib | |
| parent | 0ab7245c4648c4a05f0cd16c345522a080141006 (diff) | |
| download | bcm5719-llvm-abc24fdb943f5b188c4b362551167d5cbe5de527.tar.gz bcm5719-llvm-abc24fdb943f5b188c4b362551167d5cbe5de527.zip | |
[X86] Only extract constant pool shuffle mask data with zero offsets
D53306 exposes an issue where we sometimes use constant pool data from bigger vectors than the target shuffle mask. This should be safe to do, but we have to be certain that we're using the bottom most part of the vector as the shuffle mask decoders have no way to peek into subvectors with non-zero offsets.
llvm-svn: 344867
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86MCInstLower.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index be6f9ed2188..8dc9f624554 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -5536,7 +5536,7 @@ static const Constant *getTargetConstantFromNode(SDValue Op) { Ptr = Ptr->getOperand(0); auto *CNode = dyn_cast<ConstantPoolSDNode>(Ptr); - if (!CNode || CNode->isMachineConstantPoolEntry()) + if (!CNode || CNode->isMachineConstantPoolEntry() || CNode->getOffset() != 0) return nullptr; return dyn_cast<Constant>(CNode->getConstVal()); diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp index 76f0dd4837b..58b1c505944 100644 --- a/llvm/lib/Target/X86/X86MCInstLower.cpp +++ b/llvm/lib/Target/X86/X86MCInstLower.cpp @@ -1379,7 +1379,7 @@ PrevCrossBBInst(MachineBasicBlock::const_iterator MBBI) { static const Constant *getConstantFromPool(const MachineInstr &MI, const MachineOperand &Op) { - if (!Op.isCPI()) + if (!Op.isCPI() || Op.getOffset() != 0) return nullptr; ArrayRef<MachineConstantPoolEntry> Constants = |

