Skip to content
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

[BPF][GlobalISel] select non-PreISelGenericOpcode #75034

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

inclyc
Copy link
Member

@inclyc inclyc commented Dec 11, 2023

This selects non-PreISelGenericOpcode as-is.

Depends on: #74999

@llvmbot
Copy link
Collaborator

llvmbot commented Dec 11, 2023

@llvm/pr-subscribers-llvm-globalisel

Author: Yingchi Long (inclyc)

Changes

This selects non-PreISelGenericOpcode as-is.


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

2 Files Affected:

  • (modified) llvm/lib/Target/BPF/GISel/BPFInstructionSelector.cpp (+2)
  • (modified) llvm/test/CodeGen/BPF/GlobalISel/ir-translator-ret.ll (+5)
diff --git a/llvm/lib/Target/BPF/GISel/BPFInstructionSelector.cpp b/llvm/lib/Target/BPF/GISel/BPFInstructionSelector.cpp
index 1effeb7a57b13..c7db93a260c47 100644
--- a/llvm/lib/Target/BPF/GISel/BPFInstructionSelector.cpp
+++ b/llvm/lib/Target/BPF/GISel/BPFInstructionSelector.cpp
@@ -76,6 +76,8 @@ BPFInstructionSelector::BPFInstructionSelector(const BPFTargetMachine &TM,
 }
 
 bool BPFInstructionSelector::select(MachineInstr &I) {
+  if (!isPreISelGenericOpcode(I.getOpcode()))
+    return true;
   if (selectImpl(I, *CoverageInfo))
     return true;
   return false;
diff --git a/llvm/test/CodeGen/BPF/GlobalISel/ir-translator-ret.ll b/llvm/test/CodeGen/BPF/GlobalISel/ir-translator-ret.ll
index 7a014f7841fc8..031e82dcb67bd 100644
--- a/llvm/test/CodeGen/BPF/GlobalISel/ir-translator-ret.ll
+++ b/llvm/test/CodeGen/BPF/GlobalISel/ir-translator-ret.ll
@@ -1,7 +1,12 @@
 ; RUN: llc -mtriple=bpfel -global-isel -verify-machineinstrs -stop-after=irtranslator < %s | FileCheck %s
+; RUN: llc -mtriple=bpfel -global-isel -verify-machineinstrs < %s | FileCheck --check-prefix=ISEL %s
 
 ; CHECK: name: f
 ; CHECK: RET
 define void @f() {
+; ISEL-LABEL: f:
+; ISEL:       # %bb.0:
+; ISEL-NEXT:  exit
+; ISEL-NEXT: .Lfunc_end0:
   ret void
 }

@inclyc inclyc requested a review from arsenm December 11, 2023 09:42
Base automatically changed from users/inclyc/bpf-gisel to main December 11, 2023 11:58
This selects non-PreISelGenericOpcode as-is.

Co-authored-by: Origami404 <Origami404@foxmail.com>
@inclyc inclyc force-pushed the users/inclyc/bpf-gisel-select-pre-isel-gopcode branch from 7684e98 to 07c2c5b Compare December 11, 2023 12:05
Copy link
Member Author

@inclyc inclyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Landing this as it is trivial

@inclyc inclyc merged commit c4ac1d2 into main Dec 12, 2023
4 checks passed
@inclyc inclyc deleted the users/inclyc/bpf-gisel-select-pre-isel-gopcode branch December 12, 2023 08:19
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.

None yet

2 participants