[PATCH] D98436: [Hexagon] Support inlined use of cs0 and cs1

Sid Manning via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 11 11:09:23 PST 2021


sidneym updated this revision to Diff 330032.
sidneym added a comment.

Same patch, just added full context.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98436/new/

https://reviews.llvm.org/D98436

Files:
  clang/lib/Basic/Targets/Hexagon.cpp
  llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
  llvm/test/CodeGen/Hexagon/namedreg.ll


Index: llvm/test/CodeGen/Hexagon/namedreg.ll
===================================================================
--- llvm/test/CodeGen/Hexagon/namedreg.ll
+++ llvm/test/CodeGen/Hexagon/namedreg.ll
@@ -4,10 +4,29 @@
   %0 = call i32 @llvm.read_register.i32(metadata !0)
   ret i32 %0
 }
-
 declare i32 @llvm.read_register.i32(metadata) #1
 
+define dso_local i32 @rcs0() #0 {
+entry:
+  %0 = call i32 @llvm.read_register.i32(metadata !1)
+  ret i32 %0
+}
+
+define dso_local i32 @rcs1() #0 {
+entry:
+  %0 = call i32 @llvm.read_register.i32(metadata !2)
+  ret i32 %0
+}
+
+
+
 !llvm.named.register.r19 = !{!0}
+!llvm.named.register.cs0 = !{!1}
+!llvm.named.register.cs1 = !{!2}
 
 !0 = !{!"r19"}
+!1 = !{!"cs0"}
+!2 = !{!"cs1"}
 ; CHECK: r0 = r19
+; CHECK: r0 = cs0
+; CHECK: r0 = cs1
Index: llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
===================================================================
--- llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
+++ llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
@@ -308,6 +308,8 @@
                      .Case("m1", Hexagon::M1)
                      .Case("usr", Hexagon::USR)
                      .Case("ugp", Hexagon::UGP)
+                     .Case("cs0", Hexagon::CS0)
+                     .Case("cs1", Hexagon::CS1)
                      .Default(Register());
   if (Reg)
     return Reg;
Index: clang/lib/Basic/Targets/Hexagon.cpp
===================================================================
--- clang/lib/Basic/Targets/Hexagon.cpp
+++ clang/lib/Basic/Targets/Hexagon.cpp
@@ -136,7 +136,7 @@
     "r9",  "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17",
     "r18", "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26",
     "r27", "r28", "r29", "r30", "r31", "p0",  "p1",  "p2",  "p3",
-    "sa0", "lc0", "sa1", "lc1", "m0",  "m1",  "usr", "ugp",
+    "sa0", "lc0", "sa1", "lc1", "m0",  "m1",  "usr", "ugp", "cs0", "cs1",
     "r1:0", "r3:2", "r5:4", "r7:6", "r9:8", "r11:10", "r13:12", "r15:14",
     "r17:16", "r19:18", "r21:20", "r23:22", "r25:24", "r27:26", "r29:28",
     "r31:30"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98436.330032.patch
Type: text/x-patch
Size: 2062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210311/53cca952/attachment.bin>


More information about the cfe-commits mailing list