aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/Analysis.cpp4
-rw-r--r--lib/IR/Verifier.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/Analysis.cpp b/lib/CodeGen/Analysis.cpp
index 4731af5089..e2b2067b0c 100644
--- a/lib/CodeGen/Analysis.cpp
+++ b/lib/CodeGen/Analysis.cpp
@@ -269,6 +269,8 @@ static bool sameNoopInput(const Value *V1, const Value *V2,
i != e; ++i) {
unsigned attrInd = i - I->op_begin() + 1;
if (cast<CallInst>(I)->paramHasAttr(attrInd, Attribute::Returned) &&
+ !cast<CallInst>(I)->paramHasAttr(attrInd, Attribute::ZExt) &&
+ !cast<CallInst>(I)->paramHasAttr(attrInd, Attribute::SExt) &&
isNoopBitcast((*i)->getType(), I->getType(), TLI)) {
NoopInput = *i;
break;
@@ -282,6 +284,8 @@ static bool sameNoopInput(const Value *V1, const Value *V2,
i != e; ++i) {
unsigned attrInd = i - I->op_begin() + 1;
if (cast<InvokeInst>(I)->paramHasAttr(attrInd, Attribute::Returned) &&
+ !cast<InvokeInst>(I)->paramHasAttr(attrInd, Attribute::ZExt) &&
+ !cast<InvokeInst>(I)->paramHasAttr(attrInd, Attribute::SExt) &&
isNoopBitcast((*i)->getType(), I->getType(), TLI)) {
NoopInput = *i;
break;
diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp
index 888090db61..d106173b52 100644
--- a/lib/IR/Verifier.cpp
+++ b/lib/IR/Verifier.cpp
@@ -740,6 +740,10 @@ void Verifier::VerifyParameterAttrs(AttributeSet Attrs, unsigned Idx, Type *Ty,
Attrs.hasAttribute(Idx, Attribute::InReg))), "Attributes "
"'byval, nest, and inreg' are incompatible!", V);
+ Assert1(!(Attrs.hasAttribute(Idx, Attribute::StructRet) &&
+ Attrs.hasAttribute(Idx, Attribute::Returned)), "Attributes "
+ "'sret and returned' are incompatible!", V);
+
Assert1(!(Attrs.hasAttribute(Idx, Attribute::ZExt) &&
Attrs.hasAttribute(Idx, Attribute::SExt)), "Attributes "
"'zeroext and signext' are incompatible!", V);