It's not legal to fold a load from a narrower stack slot into a wider instruction...
commit8f0797fd72559a3066290f87c4f79a257bf64fc6
authorEvan Cheng <evan.cheng@apple.com>
Fri, 11 Sep 2009 00:39:26 +0000 (11 00:39 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 11 Sep 2009 00:39:26 +0000 (11 00:39 +0000)
tree7fddce7fcbedc911237fdf7f1d6acfd00df602fd
parent8c5f55f3e68092a732e6d3fa0dac6de724461a44
It's not legal to fold a load from a narrower stack slot into a wider instruction. If done, the instruction does a 64-bit load and that's not
safe. This can happen we a subreg_to_reg 0 has been coalesced. One
exception is when the instruction that folds the load is a move, then we
can simply turn it into a 32-bit load from the stack slot.

rdar://7170444

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81494 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrInfo.h
test/CodeGen/X86/2009-09-10-LoadFoldingBug.ll [new file with mode: 0644]