[llvm] [CodeGen] Add preliminary plumbing for `samesign` flag (PR #112354)
Thorsten Schütt via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 30 12:01:32 PDT 2024
================
@@ -0,0 +1,40 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
+# RUN: llc -x mir -march=x86-64 -run-pass=none -verify-machineinstrs %s -o - | FileCheck %s
+
+--- |
+
+ define i1 @icmp_samesign(i32 %a, i32 %b) {
+ entry:
+ %res = icmp samesign ult i32 %a, %b
+ ret i1 %res
+ }
+
+...
+---
+name: icmp_samesign
+tracksRegLiveness: true
+registers:
+ - { id: 0, class: gr32 }
+ - { id: 1, class: gr32 }
+liveins:
+ - { reg: '$edi', virtual-reg: '%0' }
+ - { reg: '$esi', virtual-reg: '%1' }
+body: |
+ bb.0:
+ liveins: $edi, $esi
+
+ ; CHECK-LABEL: name: icmp_samesign
+ ; CHECK: liveins: $edi, $esi
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: %tmp0:_(s32) = COPY $edi
+ ; CHECK-NEXT: %tmp1:_(s32) = COPY $esi
+ ; CHECK-NEXT: %tmp4:_(s8) = samesign G_ICMP intpred(ult), %tmp0(s32), %tmp1
+ ; CHECK-NEXT: $al = COPY %tmp4(s8)
+ ; CHECK-NEXT: RET 0, implicit $al
+ %tmp0:_(s32) = COPY $edi
+ %tmp1:_(s32) = COPY $esi
+ %tmp4:_(s8) = samesign G_ICMP intpred(ult), %tmp0(s32), %tmp1
----------------
tschuett wrote:
Again no test without `samesign` .
https://github.com/llvm/llvm-project/pull/112354
More information about the llvm-commits
mailing list