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

[TableGen][RISCV][GlobalISel] Select G_ICMP, G_LOAD, G_ZEXTLOAD and G_STORE #67581

Closed
wants to merge 3 commits into from

Conversation

nitinjohnraj
Copy link
Contributor

This PR represents 3 patches:

  1. [TableGen] Handle pointer types based on the hardware mode in tablegen
  2. [RISCV][GlobalISel] Select G_ICMP
  3. [RISCV][GlobalISel] Select G_LOAD, G_ZEXTLOAD, G_STORE

Patches 2 and 3 are dependent on 1. Since we don't have stacked diff workflow on github, we are using one PR with 3 patches which we will manually commit when approved.

@github-actions
Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 09c544e76012e7559a7be7fca34aeb8584da91a7 3750758854a98da5c05e780a0a41bd1cd54c47c0 -- llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp llvm/utils/TableGen/InfoByHwMode.cpp
View the diff from clang-format here.
diff --git a/llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp b/llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
index 69f2c7ce8874..efd0dfe1bf21 100644
--- a/llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
+++ b/llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
@@ -109,15 +109,12 @@ RISCVInstructionSelector::selectShiftMask(MachineOperand &Root) const {
   return {{[=](MachineInstrBuilder &MIB) { MIB.add(Root); }}};
 }
 
-
 InstructionSelector::ComplexRendererFns
 RISCVInstructionSelector::selectAddrRegImm(MachineOperand &Root) const {
   // TODO: Need to get the immediate from a G_PTR_ADD. Should this be done in
   // the combiner?
-  return {{
-        [=](MachineInstrBuilder &MIB) { MIB.addReg(Root.getReg()); },
-        [=](MachineInstrBuilder &MIB) { MIB.addImm(0); }
-    }};
+  return {{[=](MachineInstrBuilder &MIB) { MIB.addReg(Root.getReg()); },
+           [=](MachineInstrBuilder &MIB) { MIB.addImm(0); }}};
 }
 
 // Tablegen doesn't allow us to write SRLIW/SRAIW/SLLIW patterns because the

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