[llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Feb 16 10:19:55 PST 2005
Changes in directory llvm-poolalloc/lib/PoolAllocate:
PointerCompress.cpp updated: 1.16 -> 1.17
---
Log message:
Implement compression of return instructions. This allows us to pointer
compress Olden/treeadd successfully.
---
Diffs of the changes: (+10 -0)
PointerCompress.cpp | 10 ++++++++++
1 files changed, 10 insertions(+)
Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp
diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.16 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.17
--- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.16 Wed Feb 16 12:11:12 2005
+++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Wed Feb 16 12:19:42 2005
@@ -410,6 +410,7 @@
// Visitation methods. These do all of the heavy lifting for the various
// cases we have to handle.
+ void visitReturnInst(ReturnInst &RI);
void visitCastInst(CastInst &CI);
void visitPHINode(PHINode &PN);
void visitSetCondInst(SetCondInst &SCI);
@@ -460,6 +461,15 @@
}
}
+void InstructionRewriter::visitReturnInst(ReturnInst &RI) {
+ if (RI.getNumOperands() && isa<PointerType>(RI.getOperand(0)->getType()))
+ if (!isa<PointerType>(RI.getParent()->getParent()->getReturnType())) {
+ // Compressing the return value.
+ new ReturnInst(getTransformedValue(RI.getOperand(0)), &RI);
+ RI.eraseFromParent();
+ }
+}
+
void InstructionRewriter::visitCastInst(CastInst &CI) {
if (!isa<PointerType>(CI.getType())) return;
More information about the llvm-commits
mailing list