[PATCH] D20263: X86: Avoid using _chkstk when lowering WIN_ALLOCA instructions
Michael Kuperstein via llvm-commits
llvm-commits at lists.llvm.org
Mon May 16 17:02:59 PDT 2016
mkuper added inline comments.
================
Comment at: lib/Target/X86/X86WinAllocaExpander.cpp:181
@@ +180,3 @@
+ MI.getOpcode() == X86::ADJCALLSTACKUP64) {
+ Offset -= MI.getOperand(0).getImm();
+ } else if (MI.getOpcode() == X86::ADJCALLSTACKDOWN32 ||
----------------
This looks a bit scary to me. It can cause an offset to be temporary negative, and negative offsets are special-cased now, right? (Well, we'll probably never hit "-1" due to alignment anyway, but...)
I think I can live with this, though, especially since, as Dave's example shows, allocations within this region are probably broken as is, so it's not like this would make anything worse. But if we keep it as is, then I think we need at least a FIXME.
================
Comment at: lib/Target/X86/X86WinAllocaExpander.cpp:264
@@ +263,3 @@
+ MachineInstr *AmountDef = MRI->getUniqueVRegDef(AmountReg);
+ if (!AmountDef)
+ break;
----------------
Never mind, I misread, sorry for the noise.
http://reviews.llvm.org/D20263
More information about the llvm-commits
mailing list