From 9b23d57dc480a34eee9867be52b9c2022e8979f6 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Mon, 7 May 2012 21:59:31 +0000 Subject: [PATCH] Fix bug in TRI::getCommonSuperRegClass(). Test cases for this code are coming. It is not used for anything yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156327 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/TargetRegisterInfo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Target/TargetRegisterInfo.cpp b/lib/Target/TargetRegisterInfo.cpp index 532e6d23189..4acbe729d74 100644 --- a/lib/Target/TargetRegisterInfo.cpp +++ b/lib/Target/TargetRegisterInfo.cpp @@ -207,6 +207,7 @@ getCommonSuperRegClass(const TargetRegisterClass *RCA, unsigned SubA, unsigned *BestPreB = &PreB; if (RCA->getSize() < RCB->getSize()) { std::swap(RCA, RCB); + std::swap(SubA, SubB); std::swap(BestPreA, BestPreB); }