[llvm] [X86][GlobalISel] Fix referencing nonexistent operand in G_ICMP (PR #86221)

Evgenii Kudriashov via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 09:41:12 PDT 2024


================
@@ -0,0 +1,24 @@
+# RUN: llc -mtriple=x86_64-linux-gnu -run-pass=legalizer -global-isel-abort=2 -pass-remarks-missed='gisel*' %s -o - 2>%t | FileCheck %s
+# RUN: FileCheck -check-prefix=ILLEGAL %s < %t
+
+# ILLEGAL: remark: <unknown>:0:0: unable to legalize instruction: %2:_(<4 x s1>) = G_ICMP intpred(sle), %0:_(<4 x s64>), %1:_ (in function: test_icmp_v4i64)
----------------
e-kud wrote:

@phoebewang it's not a crash, actually. The crash happens if we use only `-global-isel`. This option forces llc to use only GlobalISel. The correct way is to use `-fglobal-isel` with clang or `-global-isel -global-isel-abort=2` with llc. It allows to fallback to SelectionDAG if something is unsupported in GlobalISel. Without this fix we hit the assert and are not able to fallback to SelectionDAG.

@RKSimon done.

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


More information about the llvm-commits mailing list