[llvm] r348320 - [AArch64][GlobalISel] Re-enable selection of volatile loads.
Amara Emerson via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 4 16:03:09 PST 2018
Author: aemerson
Date: Tue Dec 4 16:03:09 2018
New Revision: 348320
URL: http://llvm.org/viewvc/llvm-project?rev=348320&view=rev
Log:
[AArch64][GlobalISel] Re-enable selection of volatile loads.
We previously disabled this in r323371 because of a bug where we selected an
extending load, but didn't delete the old G_LOAD, resulting in two loads being
generated for volatile loads.
Since we now have dedicated G_SEXTLOAD/G_ZEXTLOAD operations, and that the
tablegen patterns should no longer be able to select (ext(load x)) patterns, it
should be safe to re-enable it.
The old test case should still work as expected.
Modified:
llvm/trunk/lib/Target/AArch64/AArch64InstructionSelector.cpp
llvm/trunk/test/CodeGen/AArch64/GlobalISel/irtranslator-volatile-load-pr36018.ll
Modified: llvm/trunk/lib/Target/AArch64/AArch64InstructionSelector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstructionSelector.cpp?rev=348320&r1=348319&r2=348320&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64InstructionSelector.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64InstructionSelector.cpp Tue Dec 4 16:03:09 2018
@@ -1013,12 +1013,6 @@ bool AArch64InstructionSelector::select(
}
unsigned MemSizeInBits = MemOp.getSize() * 8;
- // 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);
Modified: llvm/trunk/test/CodeGen/AArch64/GlobalISel/irtranslator-volatile-load-pr36018.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/GlobalISel/irtranslator-volatile-load-pr36018.ll?rev=348320&r1=348319&r2=348320&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/irtranslator-volatile-load-pr36018.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/irtranslator-volatile-load-pr36018.ll Tue Dec 4 16:03:09 2018
@@ -3,7 +3,7 @@
@g = global i16 0, align 2
declare void @bar(i32)
-; Check that only one load is generated. We fall back to
+; Check that only one load is generated for an extending volatile load.
define hidden void @foo() {
; CHECK-NOT: ldrh
; CHECK: ldrsh
More information about the llvm-commits
mailing list