diff options
| author | Amara Emerson <aemerson@apple.com> | 2018-01-24 20:35:37 +0000 |
|---|---|---|
| committer | Amara Emerson <aemerson@apple.com> | 2018-01-24 20:35:37 +0000 |
| commit | 4f84f8862b7495ab99121bed1d6f93525325aceb (patch) | |
| tree | 2e76ebf212dc7df1aa9da9cf641f561bd5ca9875 /llvm/test | |
| parent | 50e0372f82a7c7471e68051659a4043e1d30a9da (diff) | |
| download | bcm5719-llvm-4f84f8862b7495ab99121bed1d6f93525325aceb.tar.gz bcm5719-llvm-4f84f8862b7495ab99121bed1d6f93525325aceb.zip | |
[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.
llvm-svn: 323371
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-volatile-load-pr36018.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-volatile-load-pr36018.ll b/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-volatile-load-pr36018.ll new file mode 100644 index 00000000000..9bda39c9fca --- /dev/null +++ b/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-volatile-load-pr36018.ll @@ -0,0 +1,14 @@ +; RUN: llc -O0 -mtriple=aarch64-apple-ios -o - %s | FileCheck %s + +@g = global i16 0, align 2 +declare void @bar(i32) + +; Check that only one load is generated. We fall back to +define hidden void @foo() { +; CHECK-NOT: ldrh +; CHECK: ldrsh + %1 = load volatile i16, i16* @g, align 2 + %2 = sext i16 %1 to i32 + call void @bar(i32 %2) + ret void +} |

