summaryrefslogtreecommitdiff
path: root/lib/Target/AArch64/AArch64InstructionSelector.cpp
diff options
context:
space:
mode:
authorAmara Emerson <aemerson@apple.com>2018-01-24 20:35:37 +0000
committerAmara Emerson <aemerson@apple.com>2018-01-24 20:35:37 +0000
commit25064a712806ee3610fefc90931e469030b88869 (patch)
treee92a68a18526a52e66f76d2d4d99de96eefcb6c0 /lib/Target/AArch64/AArch64InstructionSelector.cpp
parent542b076346ab211d7783b195509ed541e9405f65 (diff)
[AArch64][GlobalISel] Fall back during AArch64 isel if we have a volatile load.
The tablegen imported patterns for sext(load(a)) don't check for single uses of the load or delete the original after matching. As a result two loads are left in the generated code. This particular issue will be fixed by adding support for a G_SEXTLOAD opcode in future. There are however other potential issues around this that wouldn't be fixed by a G_SEXTLOAD, so until we have a proper solution we don't try to handle volatile loads at all in the AArch64 selector. Fixes/works around PR36018. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323371 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/AArch64/AArch64InstructionSelector.cpp')
-rw-r--r--lib/Target/AArch64/AArch64InstructionSelector.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Target/AArch64/AArch64InstructionSelector.cpp b/lib/Target/AArch64/AArch64InstructionSelector.cpp
index 392ba13d74a..34d0483c403 100644
--- a/lib/Target/AArch64/AArch64InstructionSelector.cpp
+++ b/lib/Target/AArch64/AArch64InstructionSelector.cpp
@@ -931,6 +931,12 @@ bool AArch64InstructionSelector::select(MachineInstr &I,
return false;
}
+ // FIXME: PR36018: Volatile loads in some cases are incorrectly selected by
+ // folding with an extend. Until we have a G_SEXTLOAD solution bail out if
+ // we hit one.
+ if (Opcode == TargetOpcode::G_LOAD && MemOp.isVolatile())
+ return false;
+
const unsigned PtrReg = I.getOperand(1).getReg();
#ifndef NDEBUG
const RegisterBank &PtrRB = *RBI.getRegBank(PtrReg, MRI, TRI);