[llvm] [CodeGen] Add nneg and disjoint flags (PR #86650)
Thorsten Schütt via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 26 03:36:50 PDT 2024
================
@@ -0,0 +1,77 @@
+; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
+; RUN: llc -mtriple=aarch64-linux-gnu -O0 -stop-after=irtranslator -global-isel -verify-machineinstrs %s -o - 2>&1 | FileCheck %s
+
+define i32 @call_nneg(i16 %a) {
+ ; CHECK-LABEL: name: call_nneg
+ ; CHECK: bb.1.entry:
+ ; CHECK-NEXT: liveins: $w0
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
+ ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
+ ; CHECK-NEXT: %2:_(s32) = nneg G_ZEXT [[TRUNC]](s16)
+ ; CHECK-NEXT: $w0 = COPY %2(s32)
+ ; CHECK-NEXT: RET_ReallyLR implicit $w0
+entry:
+ %result = zext nneg i16 %a to i32
+ ret i32 %result
+}
+
+define i32 @call_not_nneg(i16 %a) {
+ ; CHECK-LABEL: name: call_not_nneg
+ ; CHECK: bb.1.entry:
+ ; CHECK-NEXT: liveins: $w0
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
+ ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
+ ; CHECK-NEXT: %2:_(s32) = nneg G_ZEXT [[TRUNC]](s16)
----------------
tschuett wrote:
I am unsure about the nneg on this line.
https://github.com/llvm/llvm-project/pull/86650
More information about the llvm-commits
mailing list