[PATCH] D20406: X86: Don't reset the stack after calls that don't return (PR27117)

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 10:30:15 PDT 2016


rnk added inline comments.

================
Comment at: include/llvm/Target/TargetLowering.h:2525
@@ -2524,1 +2524,3 @@
+          Call.doesNotReturn() ||
+          isa<UnreachableInst>(++Call.getInstruction()->getIterator());
       IsVarArg = FTy->isVarArg();
----------------
Call can be an invoke, in which case it terminates, in which case this may call isa<> on an end iterator, which is bad. I think the easy way to avoid this case is check for !Call.isInvoke() && ....

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:3384
@@ -3383,1 +3383,3 @@
 
+  if (CLI.DoesNotReturn && !getTargetMachine().Options.TrapUnreachable) {
+    // No need to reset the stack after the call if the call doesn't return. To
----------------
We should kill that TargetOption eventually...


http://reviews.llvm.org/D20406





More information about the llvm-commits mailing list