[llvm] [SelectionDAG] Add preliminary plumbing for `samesign` flag (PR #112354)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 31 11:33:59 PDT 2024


================
@@ -0,0 +1,31 @@
+; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -march=aarch64 -stop-after=finalize-isel -simplify-mir -o - %s | FileCheck %s
+
+define i1 @icmp_samesign(i32 %a, i32 %b) {
+  ; CHECK-LABEL: name: icmp_samesign
+  ; CHECK: bb.0 (%ir-block.0):
+  ; CHECK-NEXT:   liveins: $w0, $w1
+  ; CHECK-NEXT: {{  $}}
+  ; CHECK-NEXT:   [[COPY:%[0-9]+]]:gpr32 = COPY $w1
+  ; CHECK-NEXT:   [[COPY1:%[0-9]+]]:gpr32 = COPY $w0
+  ; CHECK-NEXT:   [[SUBSWrr:%[0-9]+]]:gpr32 = SUBSWrr [[COPY1]], [[COPY]], implicit-def $nzcv
----------------
arsenm wrote:

Don't really care, it's easy enough to handle. I would agree preserving the flag in other contexts is beyond the scope of this patch 

https://github.com/llvm/llvm-project/pull/112354


More information about the llvm-commits mailing list