[PATCH] D124985: [CodeGenPrepare] Use const reference to avoid unnecessary APInt copy. NFC

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 12:08:28 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGedbf390d10b8: [CodeGenPrepare] Use const reference to avoid unnecessary APInt copy. NFC (authored by craig.topper).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124985/new/

https://reviews.llvm.org/D124985

Files:
  llvm/lib/CodeGen/CodeGenPrepare.cpp


Index: llvm/lib/CodeGen/CodeGenPrepare.cpp
===================================================================
--- llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -7021,7 +7021,7 @@
   ExtInst->setDebugLoc(SI->getDebugLoc());
   SI->setCondition(ExtInst);
   for (auto Case : SI->cases()) {
-    APInt NarrowConst = Case.getCaseValue()->getValue();
+    const APInt &NarrowConst = Case.getCaseValue()->getValue();
     APInt WideConst = (ExtType == Instruction::ZExt) ?
                       NarrowConst.zext(RegWidth) : NarrowConst.sext(RegWidth);
     Case.setValue(ConstantInt::get(Context, WideConst));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124985.428739.patch
Type: text/x-patch
Size: 639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220511/24a59d00/attachment.bin>


More information about the llvm-commits mailing list