<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Alex,</p>
<p>nice to hear that this is of use to you!</p>
<p>Feel free to post it on Phabricator, and please put Ulrich
Weigand as reviewer and author. I would like to be subscriber...</p>
<p>Thank you,</p>
<p>Jonas<br>
</p>
<br>
<div class="moz-cite-prefix">On 2018-07-30 16:58, Alexey Zhikhartsev
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAOyMDRN6UmzD=gxiSd7VpXEyCALgYc81_gUyDjZSMMd+r_7prg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<div dir="auto">
<div class="gmail_quote" dir="auto">
<div dir="ltr">Hi Jonas,<br>
</div>
<br>
This patch helps with a problem on our out-of-tree backend; we
would love to get some feedback about this patch from the
community and potentially upstream it. Would you mind
submitting this patch to phabricator? I understand that you
might be busy; if so, I could submit it myself (and give
credit to you, of course). Thanks!<br>
<br>
Best,<br>
Alex<br>
<br>
<br>
-----Original Message-----<br>
From: llvm-dev [mailto:<a
href="mailto:llvm-dev-bounces@lists.llvm.org"
target="_blank" rel="noreferrer" moz-do-not-send="true">llvm-dev-bounces@lists.llvm.org</a>]
On Behalf Of Jonas Paulsson via llvm-dev<br>
Sent: Wednesday, May 30, 2018 9:03 AM<br>
To: llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org"
target="_blank" rel="noreferrer" moz-do-not-send="true">llvm-dev@lists.llvm.org</a>><br>
Cc: Ulrich Weigand <<a
href="mailto:ulrich.weigand@de.ibm.com" target="_blank"
rel="noreferrer" moz-do-not-send="true">ulrich.weigand@de.ibm.com</a>><br>
Subject: [llvm-dev] InstrEmitter::CreateVirtualRegisters
handling of CopyToReg<br>
<br>
Hi,<br>
<br>
I wonder if anyone has any comment on a patch like:<br>
<br>
diff --git a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp<br>
b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp<br>
index 65ee3816f84..4780f6f0e59 100644<br>
--- a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp<br>
+++ b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp<br>
@@ -243,18 +243,21 @@ void
InstrEmitter::CreateVirtualRegisters(SDNode<br>
*Node,<br>
<br>
if (!VRBase && !IsClone && !IsCloned)<br>
for (SDNode *User : Node->uses()) {<br>
if (User->getOpcode() == ISD::CopyToReg
&&<br>
User->getOperand(2).getNode() == Node
&&<br>
User->getOperand(2).getResNo() == i) {<br>
unsigned Reg =<br>
cast<RegisterSDNode>(User->getOperand(1))->getReg();<br>
if (TargetRegisterInfo::isVirtualRegister(Reg)) {<br>
- const TargetRegisterClass *RegRC =
MRI->getRegClass(Reg);<br>
- if (RegRC == RC) {<br>
+ // Allow constraining the virtual register's
class within<br>
reason,<br>
+ // just like what AddRegisterOperand will allow.<br>
+ const TargetRegisterClass *ConstrainedRC<br>
+ = MRI->constrainRegClass(Reg, RC,
MinRCSize);<br>
+ if (ConstrainedRC) {<br>
VRBase = Reg;<br>
MIB.addReg(VRBase, RegState::Define);<br>
break;<br>
}<br>
}<br>
}<br>
}<br>
<br>
Why do the register classes currently have to match exactly in
this case?<br>
<br>
It seems that these COPYs that now remain may end up in the
same register class, if the users require it. So why not
constrain also here directly, if this is done generally when
the register is used as input?<br>
<br>
/Jonas<br>
<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank"
rel="noreferrer" moz-do-not-send="true">llvm-dev@lists.llvm.org</a><br>
<a
href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</div>
</div>
</blockquote>
<br>
</body>
</html>