Go to file
Ulrich Weigand c3b495a649 [PowerPC] Wrong fast-isel codegen for VSX floating-point loads
There were two locations where fast-isel would generate a LFD instruction
with a target register class VSFRC instead of F8RC when VSX was enabled.
This can ccause invalid registers to be used in certain cases, like:
   lfd 36, ...
instead of using a VSX load instruction.  The wrong register number gets
silently truncated, causing invalid code to be generated.


The first place is PPCFastISel::PPCEmitLoad, which had multiple problems:

1.) The IsVSSRC and IsVSFRC flags are not initialized correctly, since they
are computed from resultReg, which is still zero at this point in many cases.
Fixed by changing the helper routines to operate on a register class instead
of a register and passing in UseRC.
 
2.) Even with this fixed, Is64VSXLoad is still wrong due to a typo:

bool Is32VSXLoad = IsVSSRC && Opc == PPC::LFS;
bool Is64VSXLoad = IsVSSRC && Opc == PPC::LFD;

The second line needs to use isVSFRC (like PPCEmitStore does).

3.) Once both the above are fixed, we're now generating a VSX instruction --
but an incorrect one, since generation of an indexed instruction with null
index is wrong. Fixed by copying the code handling the same issue in
PPCEmitStore.


The second place is PPCFastISel::PPCMaterializeFP, where we would emit an
LFD to load a constant from the literal pool, and use the wrong result
register class. Fixed by hardcoding a F8RC class even on systems
supporting VSX.


Fixes: https://llvm.org/bugs/show_bug.cgi?id=28630

Differential Revision: https://reviews.llvm.org/D22632

llvm-svn: 277823
2016-08-05 15:22:05 +00:00
clang [OpenMP] Sema and parsing for 'teams distribute' pragma 2016-08-05 14:37:37 +00:00
clang-tools-extra [include-fixer] Correct some header mappings. 2016-08-05 11:54:34 +00:00
compiler-rt Reverting r277632 as it breaks the build on MacOS. 2016-08-05 03:18:27 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Make min follow the OCL 1.0 specs 2016-07-25 22:36:22 +00:00
libcxx Add MSVC specifics to .gitignore. Patch from STL@microsoft.com 2016-08-03 05:51:19 +00:00
libcxxabi Attempt to bring peace to -Werror buildbots. 2016-07-19 20:35:09 +00:00
libunwind libunwind: correct return code in unwinding trace log message 2016-07-29 21:24:19 +00:00
lld Simplify. NFC. 2016-08-05 01:25:45 +00:00
lldb Change the indexing done for kernel/kext directories to be recursive. 2016-08-05 00:44:34 +00:00
llgo [llgo] add llgo source path to LLVM_GO_PACKAGES 2016-07-27 03:01:00 +00:00
llvm [PowerPC] Wrong fast-isel codegen for VSX floating-point loads 2016-08-05 15:22:05 +00:00
openmp Add test case for nested creation of tasks 2016-08-04 14:55:56 +00:00
parallel-libs [StreamExecutor] Add KernelLoaderSpec 2016-08-03 18:04:13 +00:00
polly [DependenceInfo] Reset operations counter when setting limit. 2016-08-05 11:31:02 +00:00