Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions llvm/lib/Target/LoongArch/LoongArchSubtarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ using namespace llvm;
#define GET_SUBTARGETINFO_CTOR
#include "LoongArchGenSubtargetInfo.inc"

static cl::opt<bool> UseAA("loongarch-use-aa", cl::init(true),
cl::desc("Enable the use of AA during codegen."));

void LoongArchSubtarget::anchor() {}

// Enable use of alias analysis during code generation (during MI scheduling,
// DAGCombine, etc.).
bool LoongArchSubtarget::useAA() const { return UseAA; }

LoongArchSubtarget &LoongArchSubtarget::initializeSubtargetDependencies(
const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS,
StringRef ABIName) {
Expand Down
1 change: 1 addition & 0 deletions llvm/lib/Target/LoongArch/LoongArchSubtarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class LoongArchSubtarget : public LoongArchGenSubtargetInfo {
unsigned getMaxBytesForAlignment() const { return MaxBytesForAlignment; }
unsigned getMaxInterleaveFactor() const { return MaxInterleaveFactor; }
bool enableMachineScheduler() const override { return true; }
bool useAA() const override;
};
} // end namespace llvm

Expand Down
18 changes: 2 additions & 16 deletions llvm/test/CodeGen/LoongArch/merge-load-store.ll
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,8 @@ define void @merge_load_store(ptr noalias nocapture noundef readonly align 1 der
;
; LA64-LABEL: merge_load_store:
; LA64: # %bb.0: # %start
; LA64-NEXT: ld.b $a2, $a0, 0
; LA64-NEXT: ld.b $a3, $a0, 1
; LA64-NEXT: ld.b $a4, $a0, 2
; LA64-NEXT: ld.b $a5, $a0, 3
; LA64-NEXT: st.b $a2, $a1, 0
; LA64-NEXT: st.b $a3, $a1, 1
; LA64-NEXT: st.b $a4, $a1, 2
; LA64-NEXT: st.b $a5, $a1, 3
; LA64-NEXT: ld.b $a2, $a0, 4
; LA64-NEXT: ld.b $a3, $a0, 5
; LA64-NEXT: ld.b $a4, $a0, 6
; LA64-NEXT: ld.b $a0, $a0, 7
; LA64-NEXT: st.b $a2, $a1, 4
; LA64-NEXT: st.b $a3, $a1, 5
; LA64-NEXT: st.b $a4, $a1, 6
; LA64-NEXT: st.b $a0, $a1, 7
; LA64-NEXT: ld.d $a0, $a0, 0
; LA64-NEXT: st.d $a0, $a1, 0
; LA64-NEXT: ret
start:
%_3 = load i8, ptr %src, align 1
Expand Down
Loading