[PATCH] D59547: [X86] Remove X86 specific dag nodes for RDTSC/RDTSCP/RDPMC. NFCI

Andrea Di Biagio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 19 11:05:53 PDT 2019


andreadb marked 2 inline comments as done.
andreadb added inline comments.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:22813
+    assert(N->getNumOperands() == 3 && "Unexpected number of operands!");
+    Chain = DAG.getCopyToReg(Chain, DL, SrcReg, N->getOperand(2));
+  }
----------------
craig.topper wrote:
> I wonder if this should be glued to the MachineNode?
I think you are right. It is safer to glue it to N1. In practice, I didn't notice any regressions (even when I run some small experiments). I will chage it.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:22867
+  // the ECX register. Add 'ecx' explicitly to the chain.
+  SDValue ecx = DAG.getCopyFromReg(Chain, DL, X86::ECX, MVT::i32);
+  Results[1] = ecx;
----------------
craig.topper wrote:
> This is no longer glued to Hi. Is that ok?
Right. I think that it is safer to glue it to HI. In practice, I noticed that the rdtscp codegen works fine even without that glue operand. However, conceptually it makes sense to schedule that node together with HI.
I'll see if I can change the signature to `expandIntrinsicWChainHelper()` so that it returns a glue value.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59547/new/

https://reviews.llvm.org/D59547





More information about the llvm-commits mailing list