[llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Feb 24 17:30:32 PST 2005
Changes in directory llvm-poolalloc/lib/PoolAllocate:
PointerCompress.cpp updated: 1.26 -> 1.27
---
Log message:
teach ptrcomp to rewrite select instructions.
---
Diffs of the changes: (+11 -0)
PointerCompress.cpp | 11 +++++++++++
1 files changed, 11 insertions(+)
Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp
diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.26 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.27
--- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.26 Thu Feb 24 15:47:00 2005
+++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Thu Feb 24 19:30:19 2005
@@ -451,6 +451,7 @@
void visitReturnInst(ReturnInst &RI);
void visitCastInst(CastInst &CI);
void visitPHINode(PHINode &PN);
+ void visitSelectInst(SelectInst &SI);
void visitSetCondInst(SetCondInst &SCI);
void visitGetElementPtrInst(GetElementPtrInst &GEPI);
void visitLoadInst(LoadInst &LI);
@@ -542,6 +543,16 @@
setTransformedValue(PN, New);
}
+void InstructionRewriter::visitSelectInst(SelectInst &SI) {
+ const CompressedPoolInfo *DestPI = getPoolInfo(&SI);
+ if (DestPI == 0) return;
+
+ setTransformedValue(SI, new SelectInst(SI.getOperand(0),
+ getTransformedValue(SI.getOperand(1)),
+ getTransformedValue(SI.getOperand(2)),
+ SI.getName(), &SI));
+}
+
void InstructionRewriter::visitSetCondInst(SetCondInst &SCI) {
if (!isa<PointerType>(SCI.getOperand(0)->getType())) return;
Value *NonNullPtr = SCI.getOperand(0);
More information about the llvm-commits
mailing list