[PATCH] D84072: [GISel: Add support for CSEing SrcOps which are immediates

Aditya Nandakumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 15:06:40 PDT 2020


aditya_nandakumar created this revision.
aditya_nandakumar added reviewers: arsenm, paquette, aemerson, dsanders.
Herald added subscribers: hiraditya, wdng.
Herald added a project: LLVM.

This came up in attempting to CSE a target pseudo opcode.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84072

Files:
  llvm/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp


Index: llvm/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp
===================================================================
--- llvm/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp
+++ llvm/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp
@@ -70,6 +70,9 @@
 void CSEMIRBuilder::profileSrcOp(const SrcOp &Op,
                                  GISelInstProfileBuilder &B) const {
   switch (Op.getSrcOpKind()) {
+  case SrcOp::SrcType::Ty_Imm:
+    B.addNodeIDImmediate(static_cast<int64_t>(Op.getImm()));
+    break;
   case SrcOp::SrcType::Ty_Predicate:
     B.addNodeIDImmediate(static_cast<int64_t>(Op.getPredicate()));
     break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84072.278909.patch
Type: text/x-patch
Size: 616 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200717/c3e5e1e1/attachment.bin>


More information about the llvm-commits mailing list