summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombine.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-11 06:26:33 +0000
committerChris Lattner <sabre@nondot.org>2010-02-11 06:26:33 +0000
commit4e8137d678c7291a33aad41b2b89784c2a69db06 (patch)
tree416ab12c0ed429854538130b5b8318933d6281ca /llvm/lib/Transforms/InstCombine/InstCombine.h
parent1d4eb8fac4b82cafd82719e4fecb6e86753464ed (diff)
downloadbcm5719-llvm-4e8137d678c7291a33aad41b2b89784c2a69db06.tar.gz
bcm5719-llvm-4e8137d678c7291a33aad41b2b89784c2a69db06.zip
Rename ValueRequiresCast to ShouldOptimizeCast, to better reflect
what it does. Enhance it to return false to optimizing vector sign extensions from vector comparisions, which is the idiom used to get a splatted vector for a vector comparison. Doing this breaks vector-casts.ll, add some compensating transformations to handle the important case they cover without depending on this canonicalization. This fixes rdar://7434900 a serious pessimization of vector compares. llvm-svn: 95855
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombine.h')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombine.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombine.h b/llvm/lib/Transforms/InstCombine/InstCombine.h
index 536790004e8..09accb6b857 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombine.h
+++ b/llvm/lib/Transforms/InstCombine/InstCombine.h
@@ -199,11 +199,12 @@ private:
SmallVectorImpl<Value*> &NewIndices);
Instruction *FoldOpIntoSelect(Instruction &Op, SelectInst *SI);
- /// ValueRequiresCast - Return true if the cast from "V to Ty" actually
- /// results in any code being generated. It does not require codegen if V is
- /// simple enough or if the cast can be folded into other casts.
- bool ValueRequiresCast(Instruction::CastOps opcode,const Value *V,
- const Type *Ty);
+ /// ShouldOptimizeCast - Return true if the cast from "V to Ty" actually
+ /// results in any code being generated and is interesting to optimize out. If
+ /// the cast can be eliminated by some other simple transformation, we prefer
+ /// to do the simplification first.
+ bool ShouldOptimizeCast(Instruction::CastOps opcode,const Value *V,
+ const Type *Ty);
Instruction *visitCallSite(CallSite CS);
bool transformConstExprCastCall(CallSite CS);
OpenPOWER on IntegriCloud