summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-07-10 15:29:01 +0000
committerHal Finkel <hfinkel@anl.gov>2013-07-10 15:29:01 +0000
commite355d850d6b3f595ce58a7b612502b57ca7f3271 (patch)
tree61a72ca064ee3dc0368052923671a4e3422ce8d2 /lib
parentfaf98904b7442c8054b291c2e1ee30226abc0313 (diff)
downloadllvm-e355d850d6b3f595ce58a7b612502b57ca7f3271.tar.gz
llvm-e355d850d6b3f595ce58a7b612502b57ca7f3271.tar.bz2
llvm-e355d850d6b3f595ce58a7b612502b57ca7f3271.tar.xz
PPC: Add a better comment about the i64 FI fixup
In discussing this change with Bill Schmidt, it was decided that the original comment about negative FIs was incorrect. We'll still exclude them for now, but now with a more-accurate explanation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/PowerPC/PPCISelLowering.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp
index 791d33406c..b39f0d5367 100644
--- a/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -1043,8 +1043,19 @@ static void fixupFuncForFI(SelectionDAG &DAG, int FrameIdx, EVT VT) {
if (VT != MVT::i64)
return;
- // This should not be needed for negative FIs, which come from argument
- // lowering, because the ABI should guarentee the necessary alignment.
+ // NOTE: We'll exclude negative FIs here, which come from argument
+ // lowering, because there are no known test cases triggering this problem
+ // using packed structures (or similar). We can remove this exclusion if
+ // we find such a test case. The reason why this is so test-case driven is
+ // because this entire 'fixup' is only to prevent crashes (from the
+ // register scavenger) on not-really-valid inputs. For example, if we have:
+ // %a = alloca i1
+ // %b = bitcast i1* %a to i64*
+ // store i64* a, i64 b
+ // then the store should really be marked as 'align 1', but is not. If it
+ // were marked as 'align 1' then the indexed form would have been
+ // instruction-selected initially, and the problem this 'fixup' is preventing
+ // won't happen regardless.
if (FrameIdx < 0)
return;