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

Conversation

wangleiat
Copy link
Contributor

@wangleiat wangleiat commented Apr 11, 2024

If not performing gep splits can prevent important
optimizations, such as preventing the element indices / member offsets from
being (partially) folded into load/store instruction immediates.

@llvmbot
Copy link
Member

llvmbot commented Apr 11, 2024

@llvm/pr-subscribers-llvm-transforms

@llvm/pr-subscribers-backend-loongarch

Author: wanglei (wangleiat)

Changes

Similar to commit 2e46312.


Full diff: https://github.com/llvm/llvm-project/pull/88371.diff

1 Files Affected:

  • (modified) llvm/lib/Target/LoongArch/LoongArchISelLowering.h (+1)
diff --git a/llvm/lib/Target/LoongArch/LoongArchISelLowering.h b/llvm/lib/Target/LoongArch/LoongArchISelLowering.h
index 9e9ac0b8269291..4bb6c049f8d758 100644
--- a/llvm/lib/Target/LoongArch/LoongArchISelLowering.h
+++ b/llvm/lib/Target/LoongArch/LoongArchISelLowering.h
@@ -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.

If not performing gep splits can prevent important optimizations, such
as preventing the element indices / member offsets from being
(partially) folded into load/store instruction immediates.
@wangleiat wangleiat merged commit 8e4b089 into llvm:main Apr 15, 2024
@wangleiat wangleiat deleted the gep-split branch April 15, 2024 02:31
bazuzi pushed a commit to bazuzi/llvm-project that referenced this pull request Apr 15, 2024
If not performing gep splits can prevent important optimizations, such
as preventing the element indices / member offsets from being         
(partially) folded into load/store instruction immediates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants