Temporarily revert r61019, r61030, and r61040. These were breaking LLVM Release
builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61094 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp
index 57d3209..3270f35 100644
--- a/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/lib/Analysis/BasicAliasAnalysis.cpp
@@ -63,23 +63,12 @@
// callees could modify it.
break; // next use
case Instruction::Call:
- // If the argument to the call has the nocapture attribute, then the call
- // may store or load to the pointer, but it cannot escape.
- if (cast<CallInst>(I)->paramHasAttr(UI.getOperandNo(),
- Attribute::NoCapture))
- continue;
-
- // FIXME: MemIntrinsics should have their operands marked nocapture!
- if (isa<MemIntrinsic>(I))
- continue; // next use
- return true;
- case Instruction::Invoke:
- // If the argument to the call has the nocapture attribute, then the call
- // may store or load to the pointer, but it cannot escape.
- if (cast<InvokeInst>(I)->paramHasAttr(UI.getOperandNo()-2,
- Attribute::NoCapture))
- continue;
- return true;
+ // If the call is to a few known safe intrinsics, we know that it does
+ // not escape.
+ // TODO: Eventually just check the 'nocapture' attribute.
+ if (!isa<MemIntrinsic>(I))
+ return true;
+ break; // next use
default:
return true;
}
diff --git a/lib/AsmParser/LLLexer.cpp b/lib/AsmParser/LLLexer.cpp
index b8f497a..20b2b88 100644
--- a/lib/AsmParser/LLLexer.cpp
+++ b/lib/AsmParser/LLLexer.cpp
@@ -491,7 +491,6 @@
KEYWORD("nounwind", NOUNWIND);
KEYWORD("noreturn", NORETURN);
KEYWORD("noalias", NOALIAS);
- KEYWORD("nocapture", NOCAPTURE);
KEYWORD("byval", BYVAL);
KEYWORD("nest", NEST);
KEYWORD("readnone", READNONE);
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index 7028ea3..8b54251 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -1136,8 +1136,8 @@
%token <OtherOpVal> EXTRACTVALUE INSERTVALUE
// Function Attributes
-%token SIGNEXT ZEROEXT NORETURN INREG SRET NOUNWIND NOALIAS NOCAPTURE BYVAL
-%token READNONE READONLY GC OPTSIZE NOINLINE ALWAYSINLINE SSP SSPREQ NEST
+%token SIGNEXT ZEROEXT NORETURN INREG SRET NOUNWIND NOALIAS BYVAL NEST
+%token READNONE READONLY GC OPTSIZE NOINLINE ALWAYSINLINE SSP SSPREQ
// Visibility Styles
%token DEFAULT HIDDEN PROTECTED
@@ -1265,16 +1265,15 @@
CHECK_FOR_ERROR
};
-Attribute : ZEROEXT { $$ = Attribute::ZExt; }
- | ZEXT { $$ = Attribute::ZExt; }
- | SIGNEXT { $$ = Attribute::SExt; }
- | SEXT { $$ = Attribute::SExt; }
- | INREG { $$ = Attribute::InReg; }
- | SRET { $$ = Attribute::StructRet; }
- | NOALIAS { $$ = Attribute::NoAlias; }
- | NOCAPTURE { $$ = Attribute::NoCapture; }
- | BYVAL { $$ = Attribute::ByVal; }
- | NEST { $$ = Attribute::Nest; }
+Attribute : ZEROEXT { $$ = Attribute::ZExt; }
+ | ZEXT { $$ = Attribute::ZExt; }
+ | SIGNEXT { $$ = Attribute::SExt; }
+ | SEXT { $$ = Attribute::SExt; }
+ | INREG { $$ = Attribute::InReg; }
+ | SRET { $$ = Attribute::StructRet; }
+ | NOALIAS { $$ = Attribute::NoAlias; }
+ | BYVAL { $$ = Attribute::ByVal; }
+ | NEST { $$ = Attribute::Nest; }
| ALIGN EUINT64VAL { $$ =
Attribute::constructAlignmentFromInt($2); }
;
@@ -1332,8 +1331,6 @@
$$ = $2;
if ($$ != 0 && !isPowerOf2_32($$))
GEN_ERROR("Alignment must be a power of two");
- if ($$ > 0x40000000)
- GEN_ERROR("Alignment too large");
CHECK_FOR_ERROR
};
OptCAlign : /*empty*/ { $$ = 0; } |
@@ -1341,8 +1338,6 @@
$$ = $3;
if ($$ != 0 && !isPowerOf2_32($$))
GEN_ERROR("Alignment must be a power of two");
- if ($$ > 0x40000000)
- GEN_ERROR("Alignment too large");
CHECK_FOR_ERROR
};
@@ -1372,8 +1367,6 @@
| ALIGN EUINT64VAL {
if ($2 != 0 && !isPowerOf2_32($2))
GEN_ERROR("Alignment must be a power of two");
- if ($2 > 0x40000000)
- GEN_ERROR("Alignment too large");
CurGV->setAlignment($2);
CHECK_FOR_ERROR
};
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 2d994d4..f06c61d 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -362,20 +362,6 @@
Attributes RetAttribute = Attribute::None;
Attributes FnAttribute = Attribute::None;
for (unsigned i = 0, e = Record.size(); i != e; i += 2) {
- // FIXME: remove in LLVM 3.0
- // The alignment is stored as a 16-bit raw value from bits 31--16.
- // We shift the bits above 31 down by 11 bits.
-
- unsigned Alignment = (Record[i+1] & (0xffffull << 16)) >> 16;
- if (Alignment && !isPowerOf2_32(Alignment))
- return Error("Alignment is not a power of two.");
-
- Attributes ReconstitutedAttr = Record[i+1] & 0xffff;
- if (Alignment)
- ReconstitutedAttr |= Attribute::constructAlignmentFromInt(Alignment);
- ReconstitutedAttr |= (Record[i+1] & (0xffffull << 32)) >> 11;
- Record[i+1] = ReconstitutedAttr;
-
if (Record[i] == 0)
RetAttribute = Record[i+1];
else if (Record[i] == ~0U)
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp
index adf49a5..279e447 100644
--- a/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -122,17 +122,7 @@
for (unsigned i = 0, e = A.getNumSlots(); i != e; ++i) {
const AttributeWithIndex &PAWI = A.getSlot(i);
Record.push_back(PAWI.Index);
-
- // FIXME: remove in LLVM 3.0
- // Store the alignment in the bitcode as a 16-bit raw value instead of a
- // 5-bit log2 encoded value. Shift the bits above the alignment up by
- // 11 bits.
- uint64_t FauxAttr = PAWI.Attrs & 0xffff;
- if (PAWI.Attrs & Attribute::Alignment)
- FauxAttr |= (1ull<<16)<<(((PAWI.Attrs & Attribute::Alignment)-1) >> 16);
- FauxAttr |= (PAWI.Attrs & (0x3FFull << 21)) << 11;
-
- Record.push_back(FauxAttr);
+ Record.push_back(PAWI.Attrs);
}
Stream.EmitRecord(bitc::PARAMATTR_CODE_ENTRY, Record);
diff --git a/lib/VMCore/Attributes.cpp b/lib/VMCore/Attributes.cpp
index dd47814..92acc11 100644
--- a/lib/VMCore/Attributes.cpp
+++ b/lib/VMCore/Attributes.cpp
@@ -37,8 +37,6 @@
Result += "inreg ";
if (Attrs & Attribute::NoAlias)
Result += "noalias ";
- if (Attrs & Attribute::NoCapture)
- Result += "nocapture ";
if (Attrs & Attribute::StructRet)
Result += "sret ";
if (Attrs & Attribute::ByVal)
@@ -61,11 +59,10 @@
Result += "sspreq ";
if (Attrs & Attribute::Alignment) {
Result += "align ";
- Result += utostr(1ull << (((Attrs & Attribute::Alignment)>>16) - 1));
+ Result += utostr((Attrs & Attribute::Alignment) >> 16);
Result += " ";
}
// Trim the trailing space.
- assert(!Result.empty() && "Unknown attribute!");
Result.erase(Result.end()-1);
return Result;
}
@@ -79,7 +76,7 @@
if (!isa<PointerType>(Ty))
// Attributes that only apply to pointers.
- Incompatible |= ByVal | Nest | NoAlias | StructRet | NoCapture;
+ Incompatible |= ByVal | Nest | NoAlias | StructRet;
return Incompatible;
}