forked from OSchip/llvm-project
[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
This commit is contained in:
parent
0ab7245c46
commit
abc24fdb94
|
@ -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());
|
||||
|
|
|
@ -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 =
|
||||
|
|
Loading…
Reference in New Issue