[llvm] d5545a8 - [InstCombine] recognizeBSwapOrBitReverseIdiom - remove unnecessary cast. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 30 06:44:27 PDT 2020
Author: Simon Pilgrim
Date: 2020-09-30T14:44:15+01:00
New Revision: d5545a8993489ee426b757482a64c9373cf7cf38
URL: https://github.com/llvm/llvm-project/commit/d5545a8993489ee426b757482a64c9373cf7cf38
DIFF: https://github.com/llvm/llvm-project/commit/d5545a8993489ee426b757482a64c9373cf7cf38.diff
LOG: [InstCombine] recognizeBSwapOrBitReverseIdiom - remove unnecessary cast. NFCI.
Added:
Modified:
llvm/lib/Transforms/Utils/Local.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 149755bb88b8..f8e4d34cbf4e 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -3059,9 +3059,8 @@ bool llvm::recognizeBSwapOrBitReverseIdiom(
if (ITy != DemandedTy) {
Function *F = Intrinsic::getDeclaration(I->getModule(), Intrin, DemandedTy);
Value *Provider = Res->Provider;
- IntegerType *ProviderTy = cast<IntegerType>(Provider->getType());
// We may need to truncate the provider.
- if (DemandedTy != ProviderTy) {
+ if (DemandedTy != Provider->getType()) {
auto *Trunc = CastInst::Create(Instruction::Trunc, Provider, DemandedTy,
"trunc", I);
InsertedInsts.push_back(Trunc);
More information about the llvm-commits
mailing list