[llvm-branch-commits] [cfe-branch] r114350 - in /cfe/branches/Apple/whitney-IB/src: autoconf/configure.ac configure include/llvm/Config/config.h.cmake include/llvm/Config/config.h.in include/llvm/System/FEnv.h lib/Analysis/ConstantFolding.cpp test/Transforms/GlobalOpt/ctor-list-opt.ll test/Transforms/InstCombine/fold-calls.ll
Daniel Dunbar
daniel at zuster.org
Mon Sep 20 13:42:44 PDT 2010
Author: ddunbar
Date: Mon Sep 20 15:42:44 2010
New Revision: 114350
URL: http://llvm.org/viewvc/llvm-project?rev=114350&view=rev
Log:
Hold back fenv work, it is causing a GCC test suite failure and I have my
paranoid hat on. Nice hat!
--- Reverse-merging r114241 into 'src':
U src/test/Transforms/InstCombine/fold-calls.ll
--- Reverse-merging r114219 into 'src':
U src/lib/Analysis/ConstantFolding.cpp
--- Reverse-merging r114202 into 'src':
U src/test/Transforms/GlobalOpt/ctor-list-opt.ll
--- Reverse-merging r114197 into 'src':
U src/configure
--- Reverse-merging r114196 into 'src':
U src/include/llvm/Config/config.h.in
U src/include/llvm/Config/config.h.cmake
D src/include/llvm/System/FEnv.h
G src/lib/Analysis/ConstantFolding.cpp
U src/autoconf/configure.ac
--- Reverse-merging r114148 into 'src':
C src/test/Transforms/InstCombine/fold-calls.ll
G src/lib/Analysis/ConstantFolding.cpp
Summary of conflicts:
Tree conflicts: 1
...
svn rm --force src/test/Transforms/InstCombine/fold-calls.ll
Removed:
cfe/branches/Apple/whitney-IB/src/include/llvm/System/FEnv.h
cfe/branches/Apple/whitney-IB/src/test/Transforms/InstCombine/fold-calls.ll
Modified:
cfe/branches/Apple/whitney-IB/src/autoconf/configure.ac
cfe/branches/Apple/whitney-IB/src/configure
cfe/branches/Apple/whitney-IB/src/include/llvm/Config/config.h.cmake
cfe/branches/Apple/whitney-IB/src/include/llvm/Config/config.h.in
cfe/branches/Apple/whitney-IB/src/lib/Analysis/ConstantFolding.cpp
cfe/branches/Apple/whitney-IB/src/test/Transforms/GlobalOpt/ctor-list-opt.ll
Modified: cfe/branches/Apple/whitney-IB/src/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/src/autoconf/configure.ac?rev=114350&r1=114349&r2=114350&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/src/autoconf/configure.ac (original)
+++ cfe/branches/Apple/whitney-IB/src/autoconf/configure.ac Mon Sep 20 15:42:44 2010
@@ -1262,7 +1262,6 @@
AC_CHECK_HEADERS([sys/mman.h sys/param.h sys/resource.h sys/time.h])
AC_CHECK_HEADERS([sys/types.h sys/ioctl.h malloc/malloc.h mach/mach.h])
AC_CHECK_HEADERS([valgrind/valgrind.h])
-AC_CHECK_HEADERS([fenv.h])
if test "$ENABLE_THREADS" -eq 1 ; then
AC_CHECK_HEADERS(pthread.h,
AC_SUBST(HAVE_PTHREAD, 1),
Modified: cfe/branches/Apple/whitney-IB/src/configure
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/src/configure?rev=114350&r1=114349&r2=114350&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/src/configure (original)
+++ cfe/branches/Apple/whitney-IB/src/configure Mon Sep 20 15:42:44 2010
@@ -16604,175 +16604,6 @@
done
-
-for ac_header in fenv.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to llvmbugs at cs.uiuc.edu ##
-## ----------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
if test "$ENABLE_THREADS" -eq 1 ; then
for ac_header in pthread.h
Modified: cfe/branches/Apple/whitney-IB/src/include/llvm/Config/config.h.cmake
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/src/include/llvm/Config/config.h.cmake?rev=114350&r1=114349&r2=114350&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/src/include/llvm/Config/config.h.cmake (original)
+++ cfe/branches/Apple/whitney-IB/src/include/llvm/Config/config.h.cmake Mon Sep 20 15:42:44 2010
@@ -461,9 +461,6 @@
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
#cmakedefine HAVE_VALGRIND_VALGRIND_H ${HAVE_VALGRIND_VALGRIND_H}
-/* Define to 1 if you have the <fenv.h> header file. */
-#cmakedefine HAVE_FENV_H ${HAVE_FENV_H}
-
/* Define to 1 if you have the <windows.h> header file. */
#cmakedefine HAVE_WINDOWS_H ${HAVE_WINDOWS_H}
Modified: cfe/branches/Apple/whitney-IB/src/include/llvm/Config/config.h.in
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/src/include/llvm/Config/config.h.in?rev=114350&r1=114349&r2=114350&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/src/include/llvm/Config/config.h.in (original)
+++ cfe/branches/Apple/whitney-IB/src/include/llvm/Config/config.h.in Mon Sep 20 15:42:44 2010
@@ -455,9 +455,6 @@
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
#undef HAVE_VALGRIND_VALGRIND_H
-/* Define to 1 if you have the <fenv.h> header file. */
-#undef HAVE_FENV_H
-
/* Define to 1 if you have the <windows.h> header file. */
#undef HAVE_WINDOWS_H
Removed: cfe/branches/Apple/whitney-IB/src/include/llvm/System/FEnv.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/src/include/llvm/System/FEnv.h?rev=114349&view=auto
==============================================================================
--- cfe/branches/Apple/whitney-IB/src/include/llvm/System/FEnv.h (original)
+++ cfe/branches/Apple/whitney-IB/src/include/llvm/System/FEnv.h (removed)
@@ -1,50 +0,0 @@
-//===- llvm/System/FEnv.h - Host floating-point exceptions ------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides an operating system independent interface to
-// floating-point exception interfaces.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SYSTEM_FENV_H
-#define LLVM_SYSTEM_FENV_H
-
-#include "llvm/Config/config.h"
-#include <cerrno>
-#ifdef HAVE_FENV_H
-#include <fenv.h>
-#endif
-
-namespace llvm {
-namespace sys {
-
-/// llvm_fenv_clearexcept - Clear the floating-point exception state.
-static inline void llvm_fenv_clearexcept() {
-#ifdef HAVE_FENV_H
- feclearexcept(FE_ALL_EXCEPT);
-#endif
- errno = 0;
-}
-
-/// llvm_fenv_testexcept - Test if a floating-point exception was raised.
-static inline bool llvm_fenv_testexcept() {
- int errno_val = errno;
- if (errno_val == ERANGE || errno_val == EDOM)
- return true;
-#ifdef HAVE_FENV_H
- if (fetestexcept(FE_ALL_EXCEPT))
- return true;
-#endif
- return false;
-}
-
-} // End sys namespace
-} // End llvm namespace
-
-#endif
Modified: cfe/branches/Apple/whitney-IB/src/lib/Analysis/ConstantFolding.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/src/lib/Analysis/ConstantFolding.cpp?rev=114350&r1=114349&r2=114350&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/src/lib/Analysis/ConstantFolding.cpp (original)
+++ cfe/branches/Apple/whitney-IB/src/lib/Analysis/ConstantFolding.cpp Mon Sep 20 15:42:44 2010
@@ -30,7 +30,6 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/MathExtras.h"
-#include "llvm/System/FEnv.h"
#include <cerrno>
#include <cmath>
using namespace llvm;
@@ -1040,10 +1039,10 @@
static Constant *ConstantFoldFP(double (*NativeFP)(double), double V,
const Type *Ty) {
- sys::llvm_fenv_clearexcept();
+ errno = 0;
V = NativeFP(V);
- if (sys::llvm_fenv_testexcept()) {
- sys::llvm_fenv_clearexcept();
+ if (errno != 0) {
+ errno = 0;
return 0;
}
@@ -1057,10 +1056,10 @@
static Constant *ConstantFoldBinaryFP(double (*NativeFP)(double, double),
double V, double W, const Type *Ty) {
- sys::llvm_fenv_clearexcept();
+ errno = 0;
V = NativeFP(V, W);
- if (sys::llvm_fenv_testexcept()) {
- sys::llvm_fenv_clearexcept();
+ if (errno != 0) {
+ errno = 0;
return 0;
}
Modified: cfe/branches/Apple/whitney-IB/src/test/Transforms/GlobalOpt/ctor-list-opt.ll
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/src/test/Transforms/GlobalOpt/ctor-list-opt.ll?rev=114350&r1=114349&r2=114350&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/src/test/Transforms/GlobalOpt/ctor-list-opt.ll (original)
+++ cfe/branches/Apple/whitney-IB/src/test/Transforms/GlobalOpt/ctor-list-opt.ll Mon Sep 20 15:42:44 2010
@@ -74,7 +74,7 @@
declare double @cos(double)
define internal void @CTOR8() {
- %X = call double @cos( double 0.000000e+00 ) ; <double> [#uses=1]
+ %X = call double @cos( double 1.000000e+00 ) ; <double> [#uses=1]
store double %X, double* @D
ret void
}
Removed: cfe/branches/Apple/whitney-IB/src/test/Transforms/InstCombine/fold-calls.ll
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/src/test/Transforms/InstCombine/fold-calls.ll?rev=114349&view=auto
==============================================================================
--- cfe/branches/Apple/whitney-IB/src/test/Transforms/InstCombine/fold-calls.ll (original)
+++ cfe/branches/Apple/whitney-IB/src/test/Transforms/InstCombine/fold-calls.ll (removed)
@@ -1,23 +0,0 @@
-; RUN: opt -instcombine -S < %s | FileCheck %s
-
-; This test is inexplicably still failing, which suggests a
-; bug in the host libm.
-; XFAIL: arm-linux
-
-; This shouldn't fold, because sin(inf) is invalid.
-; CHECK: @foo
-; CHECK: %t = call double @sin(double 0x7FF0000000000000)
-define double @foo() {
- %t = call double @sin(double 0x7FF0000000000000)
- ret double %t
-}
-
-; This should fold.
-; CHECK: @bar
-; CHECK: ret double 0.0
-define double @bar() {
- %t = call double @sin(double 0.0)
- ret double %t
-}
-
-declare double @sin(double)
More information about the llvm-branch-commits
mailing list