mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[X86] Don't call hasFnAttribute and getFnAttribute for 'prefer-vector-width' and 'min-legal-vector-width' in getSubtargetImpl
We only need to call getFnAttribute and then check if the Attribute is None or not.
This commit is contained in:
parent
36eea6621c
commit
5106495e6e
@ -254,8 +254,9 @@ X86TargetMachine::getSubtargetImpl(const Function &F) const {
|
||||
|
||||
// Extract prefer-vector-width attribute.
|
||||
unsigned PreferVectorWidthOverride = 0;
|
||||
if (F.hasFnAttribute("prefer-vector-width")) {
|
||||
StringRef Val = F.getFnAttribute("prefer-vector-width").getValueAsString();
|
||||
Attribute PreferVecWidthAttr = F.getFnAttribute("prefer-vector-width");
|
||||
if (!PreferVecWidthAttr.hasAttribute(Attribute::None)) {
|
||||
StringRef Val = PreferVecWidthAttr.getValueAsString();
|
||||
unsigned Width;
|
||||
if (!Val.getAsInteger(0, Width)) {
|
||||
Key += "prefer-vector-width=";
|
||||
@ -266,9 +267,9 @@ X86TargetMachine::getSubtargetImpl(const Function &F) const {
|
||||
|
||||
// Extract min-legal-vector-width attribute.
|
||||
unsigned RequiredVectorWidth = UINT32_MAX;
|
||||
if (F.hasFnAttribute("min-legal-vector-width")) {
|
||||
StringRef Val =
|
||||
F.getFnAttribute("min-legal-vector-width").getValueAsString();
|
||||
Attribute MinLegalVecWidthAttr = F.getFnAttribute("min-legal-vector-width");
|
||||
if (!MinLegalVecWidthAttr.hasAttribute(Attribute::None)) {
|
||||
StringRef Val = MinLegalVecWidthAttr.getValueAsString();
|
||||
unsigned Width;
|
||||
if (!Val.getAsInteger(0, Width)) {
|
||||
Key += "min-legal-vector-width=";
|
||||
|
Loading…
x
Reference in New Issue
Block a user