[PATCH] D75421: [AArch64][GlobalISel] Avoid copies to target register bank for subregister copies

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 09:35:45 PST 2020


paquette added a comment.

I think this looks good; just a couple nits on the testcase.



================
Comment at: llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp:772
+        const TargetRegisterClass *SubregRC =
+            getMinClassForRegBank(SrcRegBank, DstSize, true);
+        getSubRegForClass(SubregRC, TRI, SubReg);
----------------
On calls to `getMinClassForRegBank`, can we add a comment like below?

```
getMinClassForRegBank(SrcRegBank, DstSize, /* GetAllRegSet = */ true)
```


================
Comment at: llvm/test/CodeGen/AArch64/GlobalISel/subreg-copy.mir:4
+--- |
+  target triple = "aarch64"
+
----------------
This isn't necessary, because the runline already specifies the triple.


================
Comment at: llvm/test/CodeGen/AArch64/GlobalISel/subreg-copy.mir:8-18
+  define void @test_128_fpr_truncation() #0 {
+  entry:
+    %0 = load i128, i128* @a, align 16
+    %conv = trunc i128 %0 to i64
+    %and = and i64 %conv, 1
+    %tobool = icmp ne i64 %and, 0
+    br i1 %tobool, label %end, label %end
----------------
The actual IR here isn't necessary; it can probably just be

```
define void @test_128_fpr_truncation() { ret void }
```


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

https://reviews.llvm.org/D75421





More information about the llvm-commits mailing list