summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorManuel Jacob <me@manueljacob.de>2015-12-19 18:38:42 +0000
committerManuel Jacob <me@manueljacob.de>2015-12-19 18:38:42 +0000
commit5b90b147d4707cfde53f53faa3e8ad41683ece65 (patch)
treee73d44c3a703d8c1e9f21e2b1a9d5a715ab29767 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parentf4b3577d66cbc5111f6aaeaf570bbc74e8b56de3 (diff)
downloadbcm5719-llvm-5b90b147d4707cfde53f53faa3e8ad41683ece65.tar.gz
bcm5719-llvm-5b90b147d4707cfde53f53faa3e8ad41683ece65.zip
Remove unnecessary casts. NFC.
llvm-svn: 256101
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 3b721417ed5..5844124d856 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -638,21 +638,20 @@ simplifyRelocatesOffABase(IntrinsicInst *RelocatedBase,
// In this case, we can not find the bitcast any more. So we insert a new bitcast
// no matter there is already one or not. In this way, we can handle all cases, and
// the extra bitcast should be optimized away in later passes.
- Instruction *ActualRelocatedBase = RelocatedBase;
+ Value *ActualRelocatedBase = RelocatedBase;
if (RelocatedBase->getType() != Base->getType()) {
ActualRelocatedBase =
- cast<Instruction>(Builder.CreateBitCast(RelocatedBase, Base->getType()));
+ Builder.CreateBitCast(RelocatedBase, Base->getType());
}
Value *Replacement = Builder.CreateGEP(
Derived->getSourceElementType(), ActualRelocatedBase, makeArrayRef(OffsetV));
- Instruction *ReplacementInst = cast<Instruction>(Replacement);
Replacement->takeName(ToReplace);
// If the newly generated derived pointer's type does not match the original derived
// pointer's type, cast the new derived pointer to match it. Same reasoning as above.
- Instruction *ActualReplacement = ReplacementInst;
- if (ReplacementInst->getType() != ToReplace->getType()) {
+ Value *ActualReplacement = Replacement;
+ if (Replacement->getType() != ToReplace->getType()) {
ActualReplacement =
- cast<Instruction>(Builder.CreateBitCast(ReplacementInst, ToReplace->getType()));
+ Builder.CreateBitCast(Replacement, ToReplace->getType());
}
ToReplace->replaceAllUsesWith(ActualReplacement);
ToReplace->eraseFromParent();
OpenPOWER on IntegriCloud