[PATCH] D20295: When looking for a spill slot in reg scavenger, find one that matches RC

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 06:15:20 PDT 2016


kparzysz added inline comments.

================
Comment at: llvm/trunk/lib/CodeGen/RegisterScavenging.cpp:445
@@ +444,3 @@
+      llvm_unreachable(Msg.str().c_str());
+      report_fatal_error(Msg);
+    }
----------------
MatzeB wrote:
> kparzysz wrote:
> > I kept both.
> This makes no sense. llvm_unreachable() is an indication that this case cannot happen and the compiler will actually optimize for this. There is a high chance it remove the report_fatal_error() in this case.
> If you have an error that could actually be provoked by a user of the compiler (through inline assembly or similar) then report_fatal_error() is apropriate. If the problem can only be caused by a bug in llvm then llvm_unreachable() should be used.
With assertions enabled, llvm_unreachable is the more interesting way to terminate the program, since it will print the call stack.  The report_fatal_error will never execute, which is fine.  In the release mode, llvm_unreachable will expand to nothing (as per Quentin's earlier remark), but we still want the program to terminate with a meaningful message.  It looks strange, but it was intentional.


Repository:
  rL LLVM

http://reviews.llvm.org/D20295





More information about the llvm-commits mailing list