Thanks, I'll take a look ASAP.<br><br>On Friday, April 15, 2016, Mikael Holmén <<a href="mailto:mikael.holmen@ericsson.com">mikael.holmen@ericsson.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi David,<br>
<br>
With this commit the following code crashes instcombine:<br>
<br>
declare float @fabsf()<br>
<br>
define void @foo() {<br>
%_tmp4 = call float @fabsf()<br>
store float %_tmp4, float* undef<br>
%_tmp5 = load float, float* undef<br>
%_tmp6 = fcmp olt float %_tmp5, 0.000000e+00<br>
br i1 %_tmp6, label %bb_lslct16, label %bb_lslct16<br>
<br>
bb_lslct16: ; preds = %0, %0<br>
ret void<br>
}<br>
<br>
build-all/bin/opt -S -instcombine crash.ll<br>
handled by SimplifyFCmpInst<br>
UNREACHABLE executed at ../lib/Transforms/InstCombine/InstCombineCompares.cpp:4582!<br>
<br>
--debug printouts:<br>
<br>
Args: build-all/bin/opt -S -instcombine crash.ll --debug<br>
<br>
<br>
INSTCOMBINE ITERATION #1 on foo<br>
IC: ADDING: 6 instrs to worklist<br>
IC: Visiting: %_tmp4 = call float @fabsf()<br>
IC: Visiting: store float %_tmp4, float* undef<br>
IC: Visiting: %_tmp5 = load float, float* undef<br>
IC: Replacing %_tmp5 = load float, float* undef, align 4<br>
with %_tmp4 = call float @fabsf()<br>
IC: Mod = %_tmp5 = load float, float* undef<br>
New = %_tmp5 = load float, float* undef, align 4<br>
IC: ERASE %_tmp5 = load float, float* undef, align 4<br>
IC: Visiting: %_tmp6 = fcmp olt float %_tmp4, 0.000000e+00<br>
handled by SimplifyFCmpInst<br>
UNREACHABLE executed at ../lib/Transforms/InstCombine/InstCombineCompares.cpp:4582!<br>
<br>
Regards,<br>
Mikael<br>
<br>
On 04/13/2016 08:55 AM, David Majnemer via llvm-commits wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: majnemer<br>
Date: Wed Apr 13 01:55:52 2016<br>
New Revision: 266175<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=266175&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=266175&view=rev</a><br>
Log:<br>
[InstCombine] We folded an fcmp to an i1 instead of a vector of i1<br>
<br>
Remove an ad-hoc transform in InstCombine and replace it with more<br>
general machinery (ValueTracking, InstructionSimplify and VectorUtils).<br>
<br>
This fixes PR27332.<br>
<br>
Added:<br>
llvm/trunk/test/Transforms/InstCombine/pr27332.ll<br>
Modified:<br>
llvm/trunk/include/llvm/Analysis/ValueTracking.h<br>
llvm/trunk/include/llvm/Analysis/VectorUtils.h<br>
llvm/trunk/lib/Analysis/InstructionSimplify.cpp<br>
llvm/trunk/lib/Analysis/ValueTracking.cpp<br>
llvm/trunk/lib/Analysis/VectorUtils.cpp<br>
llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp<br>
llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/ValueTracking.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ValueTracking.h?rev=266175&r1=266174&r2=266175&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ValueTracking.h?rev=266175&r1=266174&r2=266175&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/ValueTracking.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/ValueTracking.h Wed Apr 13 01:55:52 2016<br>
@@ -145,12 +145,14 @@ namespace llvm {<br>
/// CannotBeNegativeZero - Return true if we can prove that the specified FP<br>
/// value is never equal to -0.0.<br>
///<br>
- bool CannotBeNegativeZero(const Value *V, unsigned Depth = 0);<br>
+ bool CannotBeNegativeZero(const Value *V, const TargetLibraryInfo *TLI,<br>
+ unsigned Depth = 0);<br>
<br>
/// CannotBeOrderedLessThanZero - Return true if we can prove that the<br>
/// specified FP value is either a NaN or never less than 0.0.<br>
///<br>
- bool CannotBeOrderedLessThanZero(const Value *V, unsigned Depth = 0);<br>
+ bool CannotBeOrderedLessThanZero(const Value *V, const TargetLibraryInfo *TLI,<br>
+ unsigned Depth = 0);<br>
<br>
/// isBytewiseValue - If the specified value can be set by repeating the same<br>
/// byte in memory, return the i8 value that it is represented with. This is<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/VectorUtils.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/VectorUtils.h?rev=266175&r1=266174&r2=266175&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/VectorUtils.h?rev=266175&r1=266174&r2=266175&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/VectorUtils.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/VectorUtils.h Wed Apr 13 01:55:52 2016<br>
@@ -59,7 +59,8 @@ Intrinsic::ID checkBinaryFloatSignature(<br>
/// \brief Returns intrinsic ID for call.<br>
/// For the input call instruction it finds mapping intrinsic and returns<br>
/// its intrinsic ID, in case it does not found it return not_intrinsic.<br>
-Intrinsic::ID getIntrinsicIDForCall(CallInst *CI, const TargetLibraryInfo *TLI);<br>
+Intrinsic::ID getIntrinsicIDForCall(const CallInst *CI,<br>
+ const TargetLibraryInfo *TLI);<br>
<br>
/// \brief Find the operand of the GEP that should be checked for consecutive<br>
/// stores. This ignores trailing indices that have no effect on the final<br>
<br>
Modified: llvm/trunk/lib/Analysis/InstructionSimplify.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstructionSimplify.cpp?rev=266175&r1=266174&r2=266175&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstructionSimplify.cpp?rev=266175&r1=266174&r2=266175&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/InstructionSimplify.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/InstructionSimplify.cpp Wed Apr 13 01:55:52 2016<br>
@@ -794,7 +794,7 @@ static Value *SimplifyFAddInst(Value *Op<br>
<br>
// fadd X, 0 ==> X, when we know X is not -0<br>
if (match(Op1, m_Zero()) &&<br>
- (FMF.noSignedZeros() || CannotBeNegativeZero(Op0)))<br>
+ (FMF.noSignedZeros() || CannotBeNegativeZero(Op0, Q.TLI)))<br>
return Op0;<br>
<br>
// fadd [nnan ninf] X, (fsub [nnan ninf] 0, X) ==> 0<br>
@@ -830,7 +830,7 @@ static Value *SimplifyFSubInst(Value *Op<br>
<br>
// fsub X, -0 ==> X, when we know X is not -0<br>
if (match(Op1, m_NegZero()) &&<br>
- (FMF.noSignedZeros() || CannotBeNegativeZero(Op0)))<br>
+ (FMF.noSignedZeros() || CannotBeNegativeZero(Op0, Q.TLI)))<br>
return Op0;<br>
<br>
// fsub -0.0, (fsub -0.0, X) ==> X<br>
@@ -3112,7 +3112,14 @@ static Value *SimplifyFCmpInst(unsigned<br>
}<br>
<br>
// Handle fcmp with constant RHS<br>
- if (ConstantFP *CFP = dyn_cast<ConstantFP>(RHS)) {<br>
+ const ConstantFP *CFP = nullptr;<br>
+ if (const auto *RHSC = dyn_cast<Constant>(RHS)) {<br>
+ if (RHS->getType()->isVectorTy())<br>
+ CFP = dyn_cast_or_null<ConstantFP>(RHSC->getSplatValue());<br>
+ else<br>
+ CFP = dyn_cast<ConstantFP>(RHSC);<br>
+ }<br>
+ if (CFP) {<br>
// If the constant is a nan, see if we can fold the comparison based on it.<br>
if (CFP->getValueAPF().isNaN()) {<br>
if (FCmpInst::isOrdered(Pred)) // True "if ordered and foo"<br>
@@ -3120,7 +3127,7 @@ static Value *SimplifyFCmpInst(unsigned<br>
assert(FCmpInst::isUnordered(Pred) &&<br>
"Comparison must be either ordered or unordered!");<br>
// True if unordered.<br>
- return ConstantInt::getTrue(CFP->getContext());<br>
+ return ConstantInt::get(GetCompareTy(LHS), 1);<br>
}<br>
// Check whether the constant is an infinity.<br>
if (CFP->getValueAPF().isInfinity()) {<br>
@@ -3128,10 +3135,10 @@ static Value *SimplifyFCmpInst(unsigned<br>
switch (Pred) {<br>
case FCmpInst::FCMP_OLT:<br>
// No value is ordered and less than negative infinity.<br>
- return ConstantInt::getFalse(CFP->getContext());<br>
+ return ConstantInt::get(GetCompareTy(LHS), 0);<br>
case FCmpInst::FCMP_UGE:<br>
// All values are unordered with or at least negative infinity.<br>
- return ConstantInt::getTrue(CFP->getContext());<br>
+ return ConstantInt::get(GetCompareTy(LHS), 1);<br>
default:<br>
break;<br>
}<br>
@@ -3139,10 +3146,10 @@ static Value *SimplifyFCmpInst(unsigned<br>
switch (Pred) {<br>
case FCmpInst::FCMP_OGT:<br>
// No value is ordered and greater than infinity.<br>
- return ConstantInt::getFalse(CFP->getContext());<br>
+ return ConstantInt::get(GetCompareTy(LHS), 0);<br>
case FCmpInst::FCMP_ULE:<br>
// All values are unordered with and at most infinity.<br>
- return ConstantInt::getTrue(CFP->getContext());<br>
+ return ConstantInt::get(GetCompareTy(LHS), 1);<br>
default:<br>
break;<br>
}<br>
@@ -3151,13 +3158,13 @@ static Value *SimplifyFCmpInst(unsigned<br>
if (CFP->getValueAPF().isZero()) {<br>
switch (Pred) {<br>
case FCmpInst::FCMP_UGE:<br>
- if (CannotBeOrderedLessThanZero(LHS))<br>
- return ConstantInt::getTrue(CFP->getContext());<br>
+ if (CannotBeOrderedLessThanZero(LHS, Q.TLI))<br>
+ return ConstantInt::get(GetCompareTy(LHS), 1);<br>
break;<br>
case FCmpInst::FCMP_OLT:<br>
// X < 0<br>
- if (CannotBeOrderedLessThanZero(LHS))<br>
- return ConstantInt::getFalse(CFP->getContext());<br>
+ if (CannotBeOrderedLessThanZero(LHS, Q.TLI))<br>
+ return ConstantInt::get(GetCompareTy(LHS), 0);<br>
break;<br>
default:<br>
break;<br>
<br>
Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=266175&r1=266174&r2=266175&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=266175&r1=266174&r2=266175&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp Wed Apr 13 01:55:52 2016<br>
@@ -20,6 +20,7 @@<br>
#include "llvm/Analysis/MemoryBuiltins.h"<br>
#include "llvm/Analysis/Loads.h"<br>
#include "llvm/Analysis/LoopInfo.h"<br>
+#include "llvm/Analysis/VectorUtils.h"<br>
#include "llvm/IR/CallSite.h"<br>
#include "llvm/IR/ConstantRange.h"<br>
#include "llvm/IR/Constants.h"<br>
@@ -2267,7 +2268,8 @@ bool llvm::ComputeMultiple(Value *V, uns<br>
/// NOTE: this function will need to be revisited when we support non-default<br>
/// rounding modes!<br>
///<br>
-bool llvm::CannotBeNegativeZero(const Value *V, unsigned Depth) {<br>
+bool llvm::CannotBeNegativeZero(const Value *V, const TargetLibraryInfo *TLI,<br>
+ unsigned Depth) {<br>
if (const ConstantFP *CFP = dyn_cast<ConstantFP>(V))<br>
return !CFP->getValueAPF().isNegZero();<br>
<br>
@@ -2295,30 +2297,26 @@ bool llvm::CannotBeNegativeZero(const Va<br>
if (isa<SIToFPInst>(I) || isa<UIToFPInst>(I))<br>
return true;<br>
<br>
- if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(I))<br>
+ if (const CallInst *CI = dyn_cast<CallInst>(I)) {<br>
+ Intrinsic::ID IID = getIntrinsicIDForCall(CI, TLI);<br>
+ switch (IID) {<br>
+ default:<br>
+ break;<br>
// sqrt(-0.0) = -0.0, no other negative results are possible.<br>
- if (II->getIntrinsicID() == Intrinsic::sqrt)<br>
- return CannotBeNegativeZero(II->getArgOperand(0), Depth+1);<br>
-<br>
- if (const CallInst *CI = dyn_cast<CallInst>(I))<br>
- if (const Function *F = CI->getCalledFunction()) {<br>
- if (F->isDeclaration()) {<br>
- // abs(x) != -0.0<br>
- if (F->getName() == "abs") return true;<br>
- // fabs[lf](x) != -0.0<br>
- if (F->getName() == "fabs") return true;<br>
- if (F->getName() == "fabsf") return true;<br>
- if (F->getName() == "fabsl") return true;<br>
- if (F->getName() == "sqrt" || F->getName() == "sqrtf" ||<br>
- F->getName() == "sqrtl")<br>
- return CannotBeNegativeZero(CI->getArgOperand(0), Depth+1);<br>
- }<br>
+ case Intrinsic::sqrt:<br>
+ return CannotBeNegativeZero(CI->getArgOperand(0), TLI, Depth + 1);<br>
+ // fabs(x) != -0.0<br>
+ case Intrinsic::fabs:<br>
+ return true;<br>
}<br>
+ }<br>
<br>
return false;<br>
}<br>
<br>
-bool llvm::CannotBeOrderedLessThanZero(const Value *V, unsigned Depth) {<br>
+bool llvm::CannotBeOrderedLessThanZero(const Value *V,<br>
+ const TargetLibraryInfo *TLI,<br>
+ unsigned Depth) {<br>
if (const ConstantFP *CFP = dyn_cast<ConstantFP>(V))<br>
return !CFP->getValueAPF().isNegative() || CFP->getValueAPF().isZero();<br>
<br>
@@ -2344,43 +2342,44 @@ bool llvm::CannotBeOrderedLessThanZero(c<br>
case Instruction::FAdd:<br>
case Instruction::FDiv:<br>
case Instruction::FRem:<br>
- return CannotBeOrderedLessThanZero(I->getOperand(0), Depth+1) &&<br>
- CannotBeOrderedLessThanZero(I->getOperand(1), Depth+1);<br>
+ return CannotBeOrderedLessThanZero(I->getOperand(0), TLI, Depth + 1) &&<br>
+ CannotBeOrderedLessThanZero(I->getOperand(1), TLI, Depth + 1);<br>
case Instruction::Select:<br>
- return CannotBeOrderedLessThanZero(I->getOperand(1), Depth+1) &&<br>
- CannotBeOrderedLessThanZero(I->getOperand(2), Depth+1);<br>
+ return CannotBeOrderedLessThanZero(I->getOperand(1), TLI, Depth + 1) &&<br>
+ CannotBeOrderedLessThanZero(I->getOperand(2), TLI, Depth + 1);<br>
case Instruction::FPExt:<br>
case Instruction::FPTrunc:<br>
// Widening/narrowing never change sign.<br>
- return CannotBeOrderedLessThanZero(I->getOperand(0), Depth+1);<br>
- case Instruction::Call:<br>
- if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(I))<br>
- switch (II->getIntrinsicID()) {<br>
- default: break;<br>
- case Intrinsic::maxnum:<br>
- return CannotBeOrderedLessThanZero(I->getOperand(0), Depth+1) ||<br>
- CannotBeOrderedLessThanZero(I->getOperand(1), Depth+1);<br>
- case Intrinsic::minnum:<br>
- return CannotBeOrderedLessThanZero(I->getOperand(0), Depth+1) &&<br>
- CannotBeOrderedLessThanZero(I->getOperand(1), Depth+1);<br>
- case Intrinsic::exp:<br>
- case Intrinsic::exp2:<br>
- case Intrinsic::fabs:<br>
- case Intrinsic::sqrt:<br>
- return true;<br>
- case Intrinsic::powi:<br>
- if (ConstantInt *CI = dyn_cast<ConstantInt>(I->getOperand(1))) {<br>
- // powi(x,n) is non-negative if n is even.<br>
- if (CI->getBitWidth() <= 64 && CI->getSExtValue() % 2u == 0)<br>
- return true;<br>
- }<br>
- return CannotBeOrderedLessThanZero(I->getOperand(0), Depth+1);<br>
- case Intrinsic::fma:<br>
- case Intrinsic::fmuladd:<br>
- // x*x+y is non-negative if y is non-negative.<br>
- return I->getOperand(0) == I->getOperand(1) &&<br>
- CannotBeOrderedLessThanZero(I->getOperand(2), Depth+1);<br>
+ return CannotBeOrderedLessThanZero(I->getOperand(0), TLI, Depth + 1);<br>
+ case Instruction::Call:<br>
+ Intrinsic::ID IID = getIntrinsicIDForCall(cast<CallInst>(I), TLI);<br>
+ switch (IID) {<br>
+ default:<br>
+ break;<br>
+ case Intrinsic::maxnum:<br>
+ return CannotBeOrderedLessThanZero(I->getOperand(0), TLI, Depth + 1) ||<br>
+ CannotBeOrderedLessThanZero(I->getOperand(1), TLI, Depth + 1);<br>
+ case Intrinsic::minnum:<br>
+ return CannotBeOrderedLessThanZero(I->getOperand(0), TLI, Depth + 1) &&<br>
+ CannotBeOrderedLessThanZero(I->getOperand(1), TLI, Depth + 1);<br>
+ case Intrinsic::exp:<br>
+ case Intrinsic::exp2:<br>
+ case Intrinsic::fabs:<br>
+ case Intrinsic::sqrt:<br>
+ return true;<br>
+ case Intrinsic::powi:<br>
+ if (ConstantInt *CI = dyn_cast<ConstantInt>(I->getOperand(1))) {<br>
+ // powi(x,n) is non-negative if n is even.<br>
+ if (CI->getBitWidth() <= 64 && CI->getSExtValue() % 2u == 0)<br>
+ return true;<br>
}<br>
+ return CannotBeOrderedLessThanZero(I->getOperand(0), TLI, Depth + 1);<br>
+ case Intrinsic::fma:<br>
+ case Intrinsic::fmuladd:<br>
+ // x*x+y is non-negative if y is non-negative.<br>
+ return I->getOperand(0) == I->getOperand(1) &&<br>
+ CannotBeOrderedLessThanZero(I->getOperand(2), TLI, Depth + 1);<br>
+ }<br>
break;<br>
}<br>
return false;<br>
<br>
Modified: llvm/trunk/lib/Analysis/VectorUtils.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/VectorUtils.cpp?rev=266175&r1=266174&r2=266175&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/VectorUtils.cpp?rev=266175&r1=266174&r2=266175&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/VectorUtils.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/VectorUtils.cpp Wed Apr 13 01:55:52 2016<br>
@@ -121,10 +121,10 @@ llvm::checkBinaryFloatSignature(const Ca<br>
/// \brief Returns intrinsic ID for call.<br>
/// For the input call instruction it finds mapping intrinsic and returns<br>
/// its ID, in case it does not found it return not_intrinsic.<br>
-Intrinsic::ID llvm::getIntrinsicIDForCall(CallInst *CI,<br>
+Intrinsic::ID llvm::getIntrinsicIDForCall(const CallInst *CI,<br>
const TargetLibraryInfo *TLI) {<br>
// If we have an intrinsic call, check if it is trivially vectorizable.<br>
- if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(CI)) {<br>
+ if (const auto *II = dyn_cast<IntrinsicInst>(CI)) {<br>
Intrinsic::ID ID = II->getIntrinsicID();<br>
if (isTriviallyVectorizable(ID) || ID == Intrinsic::lifetime_start ||<br>
ID == Intrinsic::lifetime_end || ID == Intrinsic::assume)<br>
<br>
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp?rev=266175&r1=266174&r2=266175&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp?rev=266175&r1=266174&r2=266175&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp Wed Apr 13 01:55:52 2016<br>
@@ -4570,7 +4570,7 @@ Instruction *InstCombiner::visitFCmpInst<br>
break;<br>
// fabs(x) < 0 --> false<br>
case FCmpInst::FCMP_OLT:<br>
- return replaceInstUsesWith(I, Builder->getFalse());<br>
+ llvm_unreachable("handled by SimplifyFCmpInst");<br>
// fabs(x) > 0 --> x != 0<br>
case FCmpInst::FCMP_OGT:<br>
return new FCmpInst(FCmpInst::FCMP_ONE, CI->getArgOperand(0), RHSC);<br>
<br>
Added: llvm/trunk/test/Transforms/InstCombine/pr27332.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/pr27332.ll?rev=266175&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/pr27332.ll?rev=266175&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/Transforms/InstCombine/pr27332.ll (added)<br>
+++ llvm/trunk/test/Transforms/InstCombine/pr27332.ll Wed Apr 13 01:55:52 2016<br>
@@ -0,0 +1,11 @@<br>
+; RUN: opt -instcombine -S -o - < %s | FileCheck %s<br>
+declare <4 x float> @llvm.fabs.v4f32(<4 x float>)<br>
+<br>
+define <4 x i1> @test1(<4 x float> %V) {<br>
+entry:<br>
+ %abs = call <4 x float> @llvm.fabs.v4f32(<4 x float> %V)<br>
+ %cmp = fcmp olt <4 x float> %abs, zeroinitializer<br>
+ ret <4 x i1> %cmp<br>
+}<br>
+; CHECK-LABEL: define <4 x i1> @test1(<br>
+; CHECK: ret <4 x i1> zeroinitializer<br>
<br>
Modified: llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll?rev=266175&r1=266174&r2=266175&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll?rev=266175&r1=266174&r2=266175&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll (original)<br>
+++ llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll Wed Apr 13 01:55:52 2016<br>
@@ -1,7 +1,7 @@<br>
; NOTE: Assertions have been autogenerated by update_test_checks.py<br>
; RUN: opt < %s -instcombine -S | FileCheck %s<br>
<br>
-declare double @abs(double)<br>
+declare double @fabs(double) readonly<br>
<br>
define double @test(double %X) {<br>
; CHECK-LABEL: @test(<br>
@@ -15,10 +15,10 @@ define double @test(double %X) {<br>
<br>
define double @test1(double %X) {<br>
; CHECK-LABEL: @test1(<br>
-; CHECK-NEXT: [[Y:%.*]] = call double @abs(double %X)<br>
+; CHECK-NEXT: [[Y:%.*]] = call double @fabs(double %X)<br>
; CHECK-NEXT: ret double [[Y]]<br>
;<br>
- %Y = call double @abs(double %X)<br>
+ %Y = call double @fabs(double %X)<br>
%Z = fadd double %Y, 0.0<br>
ret double %Z<br>
}<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a>llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br>
</blockquote>
</blockquote>