[PATCH] D90829: [GlobalISel][TableGen] Fix seg fault for zero instruction
Mikael Holmén via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 23 22:49:41 PST 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5e9e335a2470: [GlobalISel][TableGen] Fix seg fault for zero instruction (authored by ehjogab, committed by uabelho).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90829/new/
https://reviews.llvm.org/D90829
Files:
llvm/test/TableGen/GlobalISelEmitter-zero-instr.td
llvm/utils/TableGen/GlobalISelEmitter.cpp
Index: llvm/utils/TableGen/GlobalISelEmitter.cpp
===================================================================
--- llvm/utils/TableGen/GlobalISelEmitter.cpp
+++ llvm/utils/TableGen/GlobalISelEmitter.cpp
@@ -5086,9 +5086,9 @@
if (Dst->isLeaf()) {
Record *RCDef = getInitValueAsRegClass(Dst->getLeafValue());
-
- const CodeGenRegisterClass &RC = Target.getRegisterClass(RCDef);
if (RCDef) {
+ const CodeGenRegisterClass &RC = Target.getRegisterClass(RCDef);
+
// We need to replace the def and all its uses with the specified
// operand. However, we must also insert COPY's wherever needed.
// For now, emit a copy and let the register allocator clean up.
Index: llvm/test/TableGen/GlobalISelEmitter-zero-instr.td
===================================================================
--- /dev/null
+++ llvm/test/TableGen/GlobalISelEmitter-zero-instr.td
@@ -0,0 +1,8 @@
+// RUN: llvm-tblgen -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common %s -o /dev/null --warn-on-skipped-patterns 2>&1 < %s 2>&1 | FileCheck %s
+
+include "llvm/Target/Target.td"
+include "GlobalISelEmitterCommon.td"
+
+// CHECK: warning: Skipped pattern: Dst pattern root isn't a known leaf
+def : Pat<(zext (i16 (trunc i32:$src))),
+ (i32 $src)>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90829.307249.patch
Type: text/x-patch
Size: 1301 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201124/3b349fbc/attachment.bin>
More information about the llvm-commits
mailing list