projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[X86][Haswell][SchedModel] Add architecture specific scheduling models.
[oota-llvm.git]
/
lib
/
Analysis
/
ConstantFolding.cpp
diff --git
a/lib/Analysis/ConstantFolding.cpp
b/lib/Analysis/ConstantFolding.cpp
index 0b6f11ad827fc7336ebb68120a28f89f7c6afdd0..8dc94219027ffd965d664ef7d8546b76803defd0 100644
(file)
--- a/
lib/Analysis/ConstantFolding.cpp
+++ b/
lib/Analysis/ConstantFolding.cpp
@@
-39,13
+39,6
@@
#ifdef HAVE_FENV_H
#include <fenv.h>
#ifdef HAVE_FENV_H
#include <fenv.h>
-#define USE_FENV
-#endif
-
-// FIXME: Clang's #include handling apparently doesn't work for libstdc++'s
-// fenv.h; see PR6907 for details.
-#if defined(__clang__) && defined(_GLIBCXX_FENV_H)
-#undef USE_FENV
#endif
using namespace llvm;
#endif
using namespace llvm;
@@
-247,7
+240,8
@@
static bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV,
// Look through ptr->int and ptr->ptr casts.
if (CE->getOpcode() == Instruction::PtrToInt ||
// Look through ptr->int and ptr->ptr casts.
if (CE->getOpcode() == Instruction::PtrToInt ||
- CE->getOpcode() == Instruction::BitCast)
+ CE->getOpcode() == Instruction::BitCast ||
+ CE->getOpcode() == Instruction::AddrSpaceCast)
return IsConstantOffsetFromGlobal(CE->getOperand(0), GV, Offset, TD);
// i32* getelementptr ([5 x i32]* @a, i32 0, i32 5)
return IsConstantOffsetFromGlobal(CE->getOperand(0), GV, Offset, TD);
// i32* getelementptr ([5 x i32]* @a, i32 0, i32 5)
@@
-1329,7
+1323,7
@@
static Constant *GetConstantFoldFPValue(double V, Type *Ty) {
namespace {
/// llvm_fenv_clearexcept - Clear the floating-point exception state.
static inline void llvm_fenv_clearexcept() {
namespace {
/// llvm_fenv_clearexcept - Clear the floating-point exception state.
static inline void llvm_fenv_clearexcept() {
-#if defined(
USE_FENV
) && HAVE_DECL_FE_ALL_EXCEPT
+#if defined(
HAVE_FENV_H
) && HAVE_DECL_FE_ALL_EXCEPT
feclearexcept(FE_ALL_EXCEPT);
#endif
errno = 0;
feclearexcept(FE_ALL_EXCEPT);
#endif
errno = 0;
@@
-1340,7
+1334,7
@@
static inline bool llvm_fenv_testexcept() {
int errno_val = errno;
if (errno_val == ERANGE || errno_val == EDOM)
return true;
int errno_val = errno;
if (errno_val == ERANGE || errno_val == EDOM)
return true;
-#if defined(
USE_FENV
) && HAVE_DECL_FE_ALL_EXCEPT && HAVE_DECL_FE_INEXACT
+#if defined(
HAVE_FENV_H
) && HAVE_DECL_FE_ALL_EXCEPT && HAVE_DECL_FE_INEXACT
if (fetestexcept(FE_ALL_EXCEPT & ~FE_INEXACT))
return true;
#endif
if (fetestexcept(FE_ALL_EXCEPT & ~FE_INEXACT))
return true;
#endif