diff options
author | Tim Northover <tnorthover@apple.com> | 2017-04-20 19:54:02 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2017-04-20 19:54:02 +0000 |
commit | 8b1240b0f09d53863cb298c7519508ddead3c957 (patch) | |
tree | 1cac9a03fa15e5a1c881534db5a93e0cf571cdd3 /llvm/lib/Target/ARM/ARMISelLowering.cpp | |
parent | 175d70ee5c2f03f640151488f5f33b7bd9b96f8d (diff) | |
download | bcm5719-llvm-8b1240b0f09d53863cb298c7519508ddead3c957.tar.gz bcm5719-llvm-8b1240b0f09d53863cb298c7519508ddead3c957.zip |
ARM: handle post-indexed NEON ops where the offset isn't the access width.
Before, we assumed that any ConstantInt offset was precisely the access width,
so we could use the "[rN]!" form. ISelLowering only ever created that kind, but
further simplification during combining could lead to unexpected constants and
incorrect codegen.
Should fix PR32658.
llvm-svn: 300878
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 88b316c1f9f..165e9b7378c 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -10873,11 +10873,8 @@ static SDValue CombineBaseUpdate(SDNode *N, // If the increment is a constant, it must match the memory ref size. SDValue Inc = User->getOperand(User->getOperand(0) == Addr ? 1 : 0); - if (ConstantSDNode *CInc = dyn_cast<ConstantSDNode>(Inc.getNode())) { - uint64_t IncVal = CInc->getZExtValue(); - if (IncVal != NumBytes) - continue; - } else if (NumBytes >= 3 * 16) { + ConstantSDNode *CInc = dyn_cast<ConstantSDNode>(Inc.getNode()); + if (NumBytes >= 3 * 16 && (!CInc || CInc->getZExtValue() != NumBytes)) { // VLD3/4 and VST3/4 for 128-bit vectors are implemented with two // separate instructions that make it harder to use a non-constant update. continue; |