Skip to content

[LoongArch] Return true from shouldConsiderGEPOffsetSplit #88371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions llvm/lib/Target/LoongArch/LoongArchISelLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ class LoongArchTargetLowering : public TargetLowering {
bool isShuffleMaskLegal(ArrayRef<int> Mask, EVT VT) const override {
return false;
}
bool shouldConsiderGEPOffsetSplit() const override { return true; }

private:
/// Target-specific function used to lower LoongArch calling conventions.
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/Transforms/CodeGenPrepare/LoongArch/splitgep.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
define void @test(ptr %sp, ptr %t, i32 %n) {
; CHECK-LABEL: @test(
; CHECK-NEXT: entry:
; CHECK-NEXT: %s = load ptr, ptr %sp, align 8
; CHECK-NEXT: br label %while_cond

; CHECK-NEXT: %splitgep1 = getelementptr i8, ptr %t, i64 80000
; CHECK-NEXT: %s = load ptr, ptr %sp
; CHECK-NEXT: %splitgep = getelementptr i8, ptr %s, i64 80000
entry:
%s = load ptr, ptr %sp
br label %while_cond
Expand Down