[llvm] r267511 - [WebAssembly] Account for implicit operands when computing operand indices.

Dan Gohman via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 18:40:57 PDT 2016


Author: djg
Date: Mon Apr 25 20:40:56 2016
New Revision: 267511

URL: http://llvm.org/viewvc/llvm-project?rev=267511&view=rev
Log:
[WebAssembly] Account for implicit operands when computing operand indices.

Modified:
    llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp
    llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg.ll

Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp?rev=267511&r1=267510&r2=267511&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp Mon Apr 25 20:40:56 2016
@@ -204,7 +204,7 @@ bool WebAssemblyFixIrreducibleControlFlo
     if (!Pair.second)
       continue;
 
-    unsigned Index = MIB.getInstr()->getNumOperands() - 1;
+    unsigned Index = MIB.getInstr()->getNumExplicitOperands() - 1;
     DEBUG(dbgs() << "MBB#" << MBB->getNumber() << " has index " << Index
                  << "\n");
 

Modified: llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg.ll?rev=267511&r1=267510&r2=267511&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg.ll Mon Apr 25 20:40:56 2016
@@ -1,4 +1,4 @@
-; RUN: llc < %s -asm-verbose=false -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -disable-block-placement | FileCheck %s
 
 ; Test irreducible CFG handling.
 
@@ -8,6 +8,9 @@ target triple = "wasm32-unknown-unknown"
 ; A simple loop with two entries.
 
 ; CHECK-LABEL: test0:
+; CHECK: f64.load
+; CHECK: i32.const $[[REG:[^,]+]]=, 0{{$}}
+; CHECK: br_table  $[[REG]],
 define void @test0(double* %arg, i32 %arg1, i32 %arg2, i32 %arg3) {
 bb:
   %tmp = icmp eq i32 %arg2, 0
@@ -46,6 +49,9 @@ bb19:
 ; A simple loop with two entries and an inner natural loop.
 
 ; CHECK-LABEL: test1:
+; CHECK: f64.load
+; CHECK: i32.const $[[REG:[^,]+]]=, 0{{$}}
+; CHECK: br_table  $[[REG]],
 define void @test1(double* %arg, i32 %arg1, i32 %arg2, i32 %arg3) {
 bb:
   %tmp = icmp eq i32 %arg2, 0




More information about the llvm-commits mailing list