[llvm] r272802 - [TargetLibraryInfo] Teach isValidProtoForLibFunc about tan
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 15 09:47:23 PDT 2016
Author: majnemer
Date: Wed Jun 15 11:47:23 2016
New Revision: 272802
URL: http://llvm.org/viewvc/llvm-project?rev=272802&view=rev
Log:
[TargetLibraryInfo] Teach isValidProtoForLibFunc about tan
We would fail to validate the type of the tan function which would cause
downstream users of isValidProtoForLibFunc to assert.
This fixes PR28143.
Added:
llvm/trunk/test/Transforms/InstCombine/pr28143.ll
Modified:
llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
Modified: llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp?rev=272802&r1=272801&r2=272802&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp Wed Jun 15 11:47:23 2016
@@ -897,6 +897,9 @@ bool TargetLibraryInfoImpl::isValidProto
case LibFunc::cos:
case LibFunc::cosf:
case LibFunc::cosl:
+ case LibFunc::tan:
+ case LibFunc::tanf:
+ case LibFunc::tanl:
case LibFunc::exp:
case LibFunc::expf:
case LibFunc::expl:
Added: llvm/trunk/test/Transforms/InstCombine/pr28143.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/pr28143.ll?rev=272802&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/pr28143.ll (added)
+++ llvm/trunk/test/Transforms/InstCombine/pr28143.ll Wed Jun 15 11:47:23 2016
@@ -0,0 +1,12 @@
+; RUN: opt -S -instcombine < %s | FileCheck %s
+
+define void @test1() {
+entry:
+ call void @tan()
+ ret void
+}
+; CHECK-LABEL: define void @test1(
+; CHECK: call void @tan()
+; CHECK-NEXT: ret void
+
+declare void @tan()
More information about the llvm-commits
mailing list