summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-12-05 23:43:59 +0000
committerChris Lattner <sabre@nondot.org>2006-12-05 23:43:59 +0000
commit6f6b49774840006a30f136ea3426c2bd39a311ca (patch)
treedf89c69d19ccb3243db5e6b15d81e6d59fa166bb
parent83830075f6bed52362a837ef94d08767f4bc9b6f (diff)
downloadbcm5719-llvm-6f6b49774840006a30f136ea3426c2bd39a311ca.tar.gz
bcm5719-llvm-6f6b49774840006a30f136ea3426c2bd39a311ca.zip
Fix Transforms/InstCombine/2006-12-05-fp-to-int-ext.ll, fixing an out-of-
stack-space issue in the ppc bootstrap. llvm-svn: 32244
-rw-r--r--llvm/lib/VMCore/Instructions.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index 65a910b8e8c..1cc04334cdb 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/lib/VMCore/Instructions.cpp
@@ -1337,7 +1337,14 @@ unsigned CastInst::isEliminableCastPair(
// PTRTOINT n/a Pointer n/a Integral Unsigned
// INTTOPTR n/a Integral Unsigned Pointer n/a
// BITCONVERT = FirstClass n/a FirstClass n/a
- //
+ //
+ // NOTE: some transforms are safe, but we consider them to be non-profitable.
+ // For example, we could merge "fptoui double to uint" + "zext uint to ulong",
+ // into "fptoui double to ulong", but this loses information about the range
+ // of the produced value (we no longer know the top-part is all zeros).
+ // Further this conversion is often much more expensive for typical hardware,
+ // and causes issues when building libgcc. We disallow fptosi+sext for the
+ // same reason.
const unsigned numCastOps =
Instruction::CastOpsEnd - Instruction::CastOpsBegin;
static const uint8_t CastResults[numCastOps][numCastOps] = {
@@ -1349,8 +1356,8 @@ unsigned CastInst::isEliminableCastPair(
{ 1, 0, 0,99,99, 0, 0,99,99,99, 0, 3 }, // Trunc -+
{ 8, 1, 9,99,99, 2, 0,99,99,99, 2, 3 }, // ZExt |
{ 8, 0, 1,99,99, 0, 2,99,99,99, 0, 3 }, // SExt |
- { 0, 1, 0,99,99, 0, 0,99,99,99, 0, 3 }, // FPToUI |
- { 0, 0, 1,99,99, 0, 0,99,99,99, 0, 3 }, // FPToSI |
+ { 0, 0, 0,99,99, 0, 0,99,99,99, 0, 3 }, // FPToUI |
+ { 0, 0, 0,99,99, 0, 0,99,99,99, 0, 3 }, // FPToSI |
{ 99,99,99, 0, 0,99,99, 0, 0,99,99, 4 }, // UIToFP +- firstOp
{ 99,99,99, 0, 0,99,99, 0, 0,99,99, 4 }, // SIToFP |
{ 99,99,99, 0, 0,99,99, 1, 0,99,99, 4 }, // FPTrunc |
OpenPOWER on IntegriCloud