[PATCH] Add infrastructure for support of multiple memory constraints.

Daniel Sanders daniel.sanders at imgtec.com
Tue Mar 10 04:19:17 PDT 2015


An updated patch will follow shortly.


================
Comment at: include/llvm/Target/TargetLowering.h:2597
@@ -2596,1 +2596,3 @@
 
+  virtual unsigned getInlineAsmMemConstraint(const std::string ConstraintCode) const {
+    // FIXME: Actually look at the constraint code.
----------------
hfinkel wrote:
> hfinkel wrote:
> > Line is too long.
> Also, you should take the std::string by const reference.
> 
> Line is too long.

It looks like I've forgotten to install my clang-format pre-commit hook again. I'll fix these.

================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:6598
@@ +6597,3 @@
+        if (ConstraintID == InlineAsm::Constraint_Unknown)
+          llvm_unreachable("Failed to convert memory constraint code to constraint id.");
+
----------------
hfinkel wrote:
> Line too long. Also, why not write?
> 
>   assert(ConstraintID != InlineAsm::Constraint_Unknown &&
>          "Failed to convert memory constraint code to constraint id.");
> 
> (same below too)
If I use an assertion, then builds without assertions enabled will act as if nothing was wrong and try to continue. For most targets, this will mean that they die in SelectInlineAsmMemoryOperand() when it returns true, but a couple targets (Mips and SystemZ) will never notice and generate code. I could change Mips and SystemZ but there's also out-of-tree targets which might do the same thing. Overall, I think it's better to fail here for all builds.

http://reviews.llvm.org/D8171

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list