[llvm] r186005 - PPC: Add a better comment about the i64 FI fixup

Hal Finkel hfinkel at anl.gov
Wed Jul 10 08:29:02 PDT 2013


Author: hfinkel
Date: Wed Jul 10 10:29:01 2013
New Revision: 186005

URL: http://llvm.org/viewvc/llvm-project?rev=186005&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp

Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=186005&r1=186004&r2=186005&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Wed Jul 10 10:29:01 2013
@@ -1043,8 +1043,19 @@ static void fixupFuncForFI(SelectionDAG
   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;
 





More information about the llvm-commits mailing list