OSDN Git Service

[Hexagon] Fix post-ra expansion of PS_wselect
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Fri, 7 Dec 2018 22:00:53 +0000 (22:00 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Fri, 7 Dec 2018 22:00:53 +0000 (22:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348655 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Hexagon/HexagonInstrInfo.cpp
test/CodeGen/Hexagon/expand-wselect.mir [new file with mode: 0644]

index a0af116..de0d6c4 100644 (file)
@@ -1293,7 +1293,6 @@ bool HexagonInstrInfo::expandPostRAPseudo(MachineInstr &MI) const {
         auto T = BuildMI(MBB, MI, DL, get(Hexagon::V6_vccombine))
                      .add(Op0)
                      .addReg(PReg, S)
-                     .add(Op1)
                      .addReg(SrcHi)
                      .addReg(SrcLo);
         if (IsDestLive)
diff --git a/test/CodeGen/Hexagon/expand-wselect.mir b/test/CodeGen/Hexagon/expand-wselect.mir
new file mode 100644 (file)
index 0000000..cb3dbc2
--- /dev/null
@@ -0,0 +1,13 @@
+# RUN: llc -march=hexagon -run-pass postrapseudos %s -o - | FileCheck %s
+
+# Check that this doesn't crash.
+# CHECK: $w2 = V6_vccombine $p0, $v1, $v0
+# CHECK: $w2 = V6_vnccombine killed $p0, $v3, $v2, implicit $w2
+
+name: fred
+tracksRegLiveness: true
+body: |
+  bb.0:
+    liveins: $p0, $w0, $w1
+    $w2 = PS_wselect killed $p0, killed $w0, killed $w1
+---