forked from OSchip/llvm-project
fix CodeGenTarget::getRegisterVTs to not return the
same vt multiple times for a register. For example, ECX is in 5 different i32 reg classes, just return 1 i32 instead of 5. llvm-svn: 99727
This commit is contained in:
parent
7bc5d9b576
commit
4a5f7be077
|
@ -61,9 +61,9 @@ EEVT::TypeSet::TypeSet(const std::vector<MVT::SimpleValueType> &VTList) {
|
|||
assert(VTList[0] != MVT::iAny && VTList[0] != MVT::vAny &&
|
||||
VTList[0] != MVT::fAny);
|
||||
|
||||
// Remove duplicates.
|
||||
// Verify no duplicates.
|
||||
array_pod_sort(TypeVec.begin(), TypeVec.end());
|
||||
TypeVec.erase(std::unique(TypeVec.begin(), TypeVec.end()), TypeVec.end());
|
||||
assert(std::unique(TypeVec.begin(), TypeVec.end()) == TypeVec.end());
|
||||
}
|
||||
|
||||
/// FillWithPossibleTypes - Set to all legal types and return true, only valid
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "CodeGenIntrinsics.h"
|
||||
#include "Record.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include <algorithm>
|
||||
using namespace llvm;
|
||||
|
@ -194,6 +195,10 @@ getRegisterVTs(Record *R) const {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove duplicates.
|
||||
array_pod_sort(Result.begin(), Result.end());
|
||||
Result.erase(std::unique(Result.begin(), Result.end()), Result.end());
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue