[llvm] r359987 - [LLParser] Remove unnecessary error check making sure NUW/NSW flags aren't set on a non-integer operation.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun May 5 10:19:23 PDT 2019
Author: ctopper
Date: Sun May 5 10:19:23 2019
New Revision: 359987
URL: http://llvm.org/viewvc/llvm-project?rev=359987&view=rev
Log:
[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
Modified:
llvm/trunk/lib/AsmParser/LLParser.cpp
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=359987&r1=359986&r2=359987&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Sun May 5 10:19:23 2019
@@ -3393,12 +3393,6 @@ bool LLParser::ParseValID(ValID &ID, Per
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:
More information about the llvm-commits
mailing list