diff options
| author | Bob Wilson <bob.wilson@apple.com> | 2010-01-30 00:41:10 +0000 |
|---|---|---|
| committer | Bob Wilson <bob.wilson@apple.com> | 2010-01-30 00:41:10 +0000 |
| commit | 4b71b6c179620c222e935390ac6b1baf9649b908 (patch) | |
| tree | 0948c1e845f7066b235aa7c215439a37609ec22c /llvm/lib/Transforms | |
| parent | 2e51136f802c580e9981b771607f8253f77fbcf7 (diff) | |
| download | bcm5719-llvm-4b71b6c179620c222e935390ac6b1baf9649b908.tar.gz bcm5719-llvm-4b71b6c179620c222e935390ac6b1baf9649b908.zip | |
Use more specific types to avoid casts. No functionality change.
llvm-svn: 94863
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index e58c954e917..422ffd03a89 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -115,9 +115,9 @@ static Instruction *InstCombineLoadCast(InstCombiner &IC, LoadInst &LI, // Okay, we are casting from one integer or pointer type to another of // the same size. Instead of casting the pointer before the load, cast // the result of the loaded value. - Value *NewLoad = + LoadInst *NewLoad = IC.Builder->CreateLoad(CastOp, LI.isVolatile(), CI->getName()); - cast<LoadInst>(NewLoad)->setAlignment(LI.getAlignment()); + NewLoad->setAlignment(LI.getAlignment()); // Now cast the result of the load. return new BitCastInst(NewLoad, LI.getType()); } @@ -202,12 +202,12 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) { // load (select (Cond, &V1, &V2)) --> select(Cond, load &V1, load &V2). if (isSafeToLoadUnconditionally(SI->getOperand(1), SI, TD) && isSafeToLoadUnconditionally(SI->getOperand(2), SI, TD)) { - Value *V1 = Builder->CreateLoad(SI->getOperand(1), + LoadInst *V1 = Builder->CreateLoad(SI->getOperand(1), SI->getOperand(1)->getName()+".val"); - Value *V2 = Builder->CreateLoad(SI->getOperand(2), + LoadInst *V2 = Builder->CreateLoad(SI->getOperand(2), SI->getOperand(2)->getName()+".val"); - cast<LoadInst>(V1)->setAlignment(LI.getAlignment()); - cast<LoadInst>(V2)->setAlignment(LI.getAlignment()); + V1->setAlignment(LI.getAlignment()); + V2->setAlignment(LI.getAlignment()); return SelectInst::Create(SI->getCondition(), V1, V2); } |

