From 2b4f2e542bc97c2e84582610d9e8677871f94459 Mon Sep 17 00:00:00 2001 From: Aditya Nandakumar Date: Thu, 18 Apr 2019 02:19:29 +0000 Subject: [PATCH] [GISel]:IRTranslator: Prefer a buidInstr form that allows CSE of cast instructions https://reviews.llvm.org/D60844 Use the style of buildInstr that allows CSEing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358637 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/GlobalISel/IRTranslator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/CodeGen/GlobalISel/IRTranslator.cpp b/lib/CodeGen/GlobalISel/IRTranslator.cpp index d368be89703..09091d3930e 100644 --- a/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -608,7 +608,7 @@ bool IRTranslator::translateCast(unsigned Opcode, const User &U, MachineIRBuilder &MIRBuilder) { unsigned Op = getOrCreateVReg(*U.getOperand(0)); unsigned Res = getOrCreateVReg(U); - MIRBuilder.buildInstr(Opcode).addDef(Res).addUse(Op); + MIRBuilder.buildInstr(Opcode, {Res}, {Op}); return true; } -- 2.50.1