Index: lib/Target/PowerPC/PPCVSXFMAMutate.cpp =================================================================== --- lib/Target/PowerPC/PPCVSXFMAMutate.cpp +++ lib/Target/PowerPC/PPCVSXFMAMutate.cpp @@ -38,8 +38,14 @@ using namespace llvm; -static cl::opt DisableVSXFMAMutate("disable-ppc-vsx-fma-mutation", -cl::desc("Disable VSX FMA instruction mutation"), cl::Hidden); +// Temporarily disable FMA mutation by default, since it doesn't handle +// cross-basic-block intervals well. +// See: http://lists.llvm.org/pipermail/llvm-dev/2016-February/095669.html +// http://reviews.llvm.org/D17087 +static cl::opt DisableVSXFMAMutate( + "disable-ppc-vsx-fma-mutation", + cl::desc("Disable VSX FMA instruction mutation"), cl::init(true), + cl::Hidden); #define DEBUG_TYPE "ppc-vsx-fma-mutate" Index: test/CodeGen/PowerPC/fma-assoc.ll =================================================================== --- test/CodeGen/PowerPC/fma-assoc.ll +++ test/CodeGen/PowerPC/fma-assoc.ll @@ -1,5 +1,5 @@ -; RUN: llc < %s -march=ppc32 -fp-contract=fast -mattr=-vsx | FileCheck %s -; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -fp-contract=fast -mattr=+vsx -mcpu=pwr7 | FileCheck -check-prefix=CHECK-VSX %s +; RUN: llc < %s -march=ppc32 -fp-contract=fast -mattr=-vsx -disable-ppc-vsx-fma-mutation=false | FileCheck %s +; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -fp-contract=fast -mattr=+vsx -mcpu=pwr7 -disable-ppc-vsx-fma-mutation=false | FileCheck -check-prefix=CHECK-VSX %s define double @test_FMADD_ASSOC1(double %A, double %B, double %C, double %D, double %E) { Index: test/CodeGen/PowerPC/fma-ext.ll =================================================================== --- test/CodeGen/PowerPC/fma-ext.ll +++ test/CodeGen/PowerPC/fma-ext.ll @@ -1,5 +1,5 @@ -; RUN: llc < %s -march=ppc32 -fp-contract=fast -mattr=-vsx | FileCheck %s -; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -fp-contract=fast -mattr=+vsx -mcpu=pwr7 | FileCheck -check-prefix=CHECK-VSX %s +; RUN: llc < %s -march=ppc32 -fp-contract=fast -mattr=-vsx -disable-ppc-vsx-fma-mutation=false | FileCheck %s +; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -fp-contract=fast -mattr=+vsx -mcpu=pwr7 -disable-ppc-vsx-fma-mutation=false | FileCheck -check-prefix=CHECK-VSX %s define double @test_FMADD_EXT1(float %A, float %B, double %C) { %D = fmul float %A, %B ; [#uses=1] Index: test/CodeGen/PowerPC/fma-mutate.ll =================================================================== --- test/CodeGen/PowerPC/fma-mutate.ll +++ test/CodeGen/PowerPC/fma-mutate.ll @@ -3,7 +3,7 @@ ; same as the FMA target register. The second one is legal. The third ; one doesn't fit the feeding-copy pattern. -; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -enable-unsafe-fp-math -mattr=+vsx | FileCheck %s +; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -enable-unsafe-fp-math -mattr=+vsx -disable-ppc-vsx-fma-mutation=false | FileCheck %s target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64" target triple = "powerpc64-unknown-linux-gnu" Index: test/CodeGen/PowerPC/fma.ll =================================================================== --- test/CodeGen/PowerPC/fma.ll +++ test/CodeGen/PowerPC/fma.ll @@ -1,7 +1,7 @@ -; RUN: llc < %s -march=ppc32 -fp-contract=fast -mattr=-vsx | FileCheck %s -; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -fp-contract=fast -mattr=+vsx -mcpu=pwr7 | FileCheck -check-prefix=CHECK-VSX %s -; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -fp-contract=fast -mcpu=pwr8 | FileCheck -check-prefix=CHECK-P8 %s -; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -fp-contract=fast -mcpu=pwr8 | FileCheck -check-prefix=CHECK-P8 %s +; RUN: llc < %s -march=ppc32 -fp-contract=fast -mattr=-vsx -disable-ppc-vsx-fma-mutation=false | FileCheck %s +; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -fp-contract=fast -mattr=+vsx -mcpu=pwr7 -disable-ppc-vsx-fma-mutation=false | FileCheck -check-prefix=CHECK-VSX %s +; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -fp-contract=fast -mcpu=pwr8 -disable-ppc-vsx-fma-mutation=false | FileCheck -check-prefix=CHECK-P8 %s +; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -fp-contract=fast -mcpu=pwr8 -disable-ppc-vsx-fma-mutation=false | FileCheck -check-prefix=CHECK-P8 %s declare double @dummy1(double) #0 declare double @dummy2(double, double) #0