[PATCH] D17427: [X86ISelLowering] Fix TLSADDR lowering when shrink-wrapping is enabled

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 17:07:10 PST 2016


qcolombet added a comment.

Hi Davide,

Thanks for fixing this.
To give a bit of context here for other reviewers, the bug is that TLSADDR are lowered into calls in MC. As a result, we need to put the “call markers” around those instructions, otherwise shrink-wrapping may push the prologue and epilogue pass them.

This mostly looks good to me see my inline comment. It misses a test case of course, but I know you’re working on it.

Cheers,
-Quentin


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:22665
@@ +22664,3 @@
+                                      MachineBasicBlock *BB) const {
+  const TargetInstrInfo &TII = *Subtarget.getInstrInfo();
+  DebugLoc DL = MI->getDebugLoc();
----------------
Add a comment saying that we want to replace TLSADDR into
adjust_stackdown
TLSADDR
adjust_stackup
and why. (You may use what I said to explain the problem.)

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:22675
@@ +22674,3 @@
+
+  // Emit CALLSEQ_END at the end of the basic block.
+  // We don't call erase from parent because we want to keep the
----------------
"after the instruction", instead of “at the end of the basic block”.


http://reviews.llvm.org/D17427





More information about the llvm-commits mailing list