summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc/PreSelection.cpp
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2003-08-06 18:42:49 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2003-08-06 18:42:49 +0000
commit26125cbeb5e47281792a7b4aca5376c2043fa9b2 (patch)
treeb2f855f76ae9ede84e617d8033f73ba3b82e5881 /llvm/lib/Target/Sparc/PreSelection.cpp
parent39a2b3aa08b13e5476ce4f39f9aa347226aa7376 (diff)
downloadbcm5719-llvm-26125cbeb5e47281792a7b4aca5376c2043fa9b2.tar.gz
bcm5719-llvm-26125cbeb5e47281792a7b4aca5376c2043fa9b2.zip
Remove conversion of fp-to-uint cast into a multi-step cast:
this is not an optional transformation on SPARC and is now handled directly by instruction selection. llvm-svn: 7644
Diffstat (limited to 'llvm/lib/Target/Sparc/PreSelection.cpp')
-rw-r--r--llvm/lib/Target/Sparc/PreSelection.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/llvm/lib/Target/Sparc/PreSelection.cpp b/llvm/lib/Target/Sparc/PreSelection.cpp
index 13f5f6e8543..8895613d32e 100644
--- a/llvm/lib/Target/Sparc/PreSelection.cpp
+++ b/llvm/lib/Target/Sparc/PreSelection.cpp
@@ -144,7 +144,6 @@ namespace {
// These methods do the actual work of specializing code
void visitInstruction(Instruction &I); // common work for every instr.
void visitGetElementPtrInst(GetElementPtrInst &I);
- void visitCastInst(CastInst &I);
void visitCallInst(CallInst &I);
// Helper functions for visiting operands of every instruction
@@ -341,34 +340,6 @@ PreSelection::visitGetElementPtrInst(GetElementPtrInst &I)
}
-// Cast instructions:
-// -- make multi-step casts explicit:
-// -- float/double to uint32_t:
-// If target does not have a float-to-unsigned instruction, we
-// need to convert to uint64_t and then to uint32_t, or we may
-// overflow the signed int representation for legal uint32_t
-// values. Expand this without checking target.
-// -- other common transformations on operands
-//
-void
-PreSelection::visitCastInst(CastInst &I)
-{
- CastInst* castI = NULL;
-
- // Check for a global and put its address into a register before this instr
- if (I.getType() == Type::UIntTy &&
- I.getOperand(0)->getType()->isFloatingPoint()) {
- // insert a cast-fp-to-long before I, and then replace the operand of I
- castI = new CastInst(I.getOperand(0), Type::LongTy, "fp2Long2Uint", &I);
- I.setOperand(0, castI); // replace fp operand with long
- }
-
- // Perform other transformations common to all instructions
- visitInstruction(I);
- if (castI)
- visitInstruction(*castI);
-}
-
void
PreSelection::visitCallInst(CallInst &I)
{
OpenPOWER on IntegriCloud