[PATCH] D48434: Fix crash on inline asm with 64bit matching input in 32bit GPR

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 26 11:13:38 PDT 2018


efriedma added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:7476
+            : ConstraintOperands[i];
     if (OpInfo.ConstraintType == TargetLowering::C_Register)
+      GetRegistersForValue(DAG, TLI, getCurSDLoc(), OpInfo, RefOpInfo);
----------------
thopre wrote:
> efriedma wrote:
> > Why is this "OpInfo.ConstraintType == TargetLowering::C_Register" here, but "RefOpInfo.ConstraintType == TargetLowering::C_RegisterClass" later?
> I didn't write these two checks but from the comment above the goal seems to distinguish between constraints for specific register (C_Register) from general register constraint (C_RegisterClass). Allocating registers for the former before the latter avoids allocating register X to a general register constraint and later dealing with a constraint asking for X specifically when there was a register Y which the general constraint would have been happy with.
Sorry, I wasn't clear; why is the first check checking OpInfo, and the second checking RefOpInfo?


Repository:
  rL LLVM

https://reviews.llvm.org/D48434





More information about the llvm-commits mailing list