[llvm] r344867 - [X86] Only extract constant pool shuffle mask data with zero offsets
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 21 04:55:57 PDT 2018
Author: rksimon
Date: Sun Oct 21 04:55:56 2018
New Revision: 344867
URL: http://llvm.org/viewvc/llvm-project?rev=344867&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Target/X86/X86MCInstLower.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=344867&r1=344866&r2=344867&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sun Oct 21 04:55:56 2018
@@ -5536,7 +5536,7 @@ static const Constant *getTargetConstant
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());
Modified: llvm/trunk/lib/Target/X86/X86MCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCInstLower.cpp?rev=344867&r1=344866&r2=344867&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86MCInstLower.cpp Sun Oct 21 04:55:56 2018
@@ -1379,7 +1379,7 @@ PrevCrossBBInst(MachineBasicBlock::const
static const Constant *getConstantFromPool(const MachineInstr &MI,
const MachineOperand &Op) {
- if (!Op.isCPI())
+ if (!Op.isCPI() || Op.getOffset() != 0)
return nullptr;
ArrayRef<MachineConstantPoolEntry> Constants =
More information about the llvm-commits
mailing list