forked from OSchip/llvm-project
[LLParser] Remove unnecessary error check making sure NUW/NSW flags aren't set on a non-integer operation.
Summary: This check appears to be a leftover from when add/sub/mul could be either integer or fp. The NSW/NUW flags are only set for add/sub/mul/shl earlier. And we check that those operations only have integer types just below this. So it seems unnecessary to explicitly error for NUW/NSW being used on a add/sub/mul that have the wrong type that would later error for that. Reviewers: spatel, dblaikie, jyknight, arsenm Reviewed By: spatel Subscribers: wdng, llvm-commits, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D61562 llvm-svn: 359987
This commit is contained in:
parent
8279695d66
commit
f6e07c472d
|
@ -3393,12 +3393,6 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
|
|||
return true;
|
||||
if (Val0->getType() != Val1->getType())
|
||||
return Error(ID.Loc, "operands of constexpr must have same type");
|
||||
if (!Val0->getType()->isIntOrIntVectorTy()) {
|
||||
if (NUW)
|
||||
return Error(ModifierLoc, "nuw only applies to integer operations");
|
||||
if (NSW)
|
||||
return Error(ModifierLoc, "nsw only applies to integer operations");
|
||||
}
|
||||
// Check that the type is valid for the operator.
|
||||
switch (Opc) {
|
||||
case Instruction::Add:
|
||||
|
|
Loading…
Reference in New Issue