From 1121c786fc24a4a8ce6c778cb9b5acdfa9006ffb Mon Sep 17 00:00:00 2001 From: Pete Cooper Date: Thu, 26 Jul 2012 22:37:04 +0000 Subject: Teach SimplifyDemandedBits how to look through fpext and fptrunc to simplify their operand git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160823 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/Transforms') diff --git a/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp index 125c74a..46ba83b 100644 --- a/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp +++ b/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp @@ -1074,6 +1074,12 @@ Value *InstCombiner::SimplifyDemandedVectorElts(Value *V, APInt DemandedElts, // like undef&0. The result is known zero, not undef. UndefElts &= UndefElts2; break; + case Instruction::FPTrunc: + case Instruction::FPExt: + TmpV = SimplifyDemandedVectorElts(I->getOperand(0), DemandedElts, + UndefElts, Depth+1); + if (TmpV) { I->setOperand(0, TmpV); MadeChange = true; } + break; case Instruction::Call: { IntrinsicInst *II = dyn_cast(I); -- cgit v1.1