From 347fd9955af3fff2622d8349a59974ecc2237ec1 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 3 Oct 2020 15:29:05 +0100 Subject: [PATCH] [InstCombine] recognizeBSwapOrBitReverseIdiom - use generic CreateIntegerCast Try to appease buildbots breakages due to D88578 --- llvm/lib/Transforms/Utils/Local.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 1c4cbc778320..d17ce2fb47c8 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -3083,7 +3083,7 @@ bool llvm::recognizeBSwapOrBitReverseIdiom( // We may need to truncate the provider. if (DemandedTy != Provider->getType()) { auto *Trunc = - CastInst::Create(Instruction::Trunc, Provider, DemandedTy, "trunc", I); + CastInst::CreateIntegerCast(Provider, DemandedTy, false, "trunc", I); InsertedInsts.push_back(Trunc); Provider = Trunc; } @@ -3099,7 +3099,7 @@ bool llvm::recognizeBSwapOrBitReverseIdiom( // We may need to zeroextend back to the result type. if (ITy != Result->getType()) { - auto *ExtInst = CastInst::Create(Instruction::ZExt, Result, ITy, "zext", I); + auto *ExtInst = CastInst::CreateIntegerCast(Result, ITy, false, "zext", I); InsertedInsts.push_back(ExtInst); }