[PATCH] D41944: [LLVM][IR][LIT] support of 'no-overflow' flag for sdiv\udiv instructions

Mohammed Agabaria via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 23:47:56 PST 2018


magabari marked 5 inline comments as done.
magabari added inline comments.


================
Comment at: lib/AsmParser/LLParser.cpp:3195
+      if (Opc == Instruction::SDiv || Opc == Instruction::UDiv) {
+        if (EatIfPresent(lltok::kw_nof)) {
+          NOF = true;
----------------
craig.topper wrote:
> What happens if 'nof' and 'mof' are both present?
it will fail in the parsing phase.
as you see 'mof' and 'nof' are exculsive, look at test div_not_allowed.ll.


================
Comment at: lib/CodeGen/ScalarizeMayOverflowDiv.cpp:265
+  Phi->addIncoming(VResult, CondBlock);
+  Phi->addIncoming(PrevPhi, PrevIfBlock);
+  I.replaceAllUsesWith(Phi);
----------------
craig.topper wrote:
> If the vector only has 1 element, PrevPhi is undef. But that's not correct is it?
No, it may happen.
also in the if (Idx > 0) you may notice that i use the PrevPhi before assigning new one so it should be defined.


https://reviews.llvm.org/D41944





More information about the llvm-commits mailing list