llvm-6502/lib
Richard Sandiford 6824f127f9 [SystemZ] Be more careful about inverting CC masks
System z branches have a mask to select which of the 4 CC values should
cause the branch to be taken.  We can invert a branch by inverting the mask.
However, not all instructions can produce all 4 CC values, so inverting
the branch like this can lead to some oddities.  For example, integer
comparisons only produce a CC of 0 (equal), 1 (less) or 2 (greater).
If an integer EQ is reversed to NE before instruction selection,
the branch will test for 1 or 2.  If instead the branch is reversed
after instruction selection (by inverting the mask), it will test for
1, 2 or 3.  Both are correct, but the second isn't really canonical.
This patch therefore keeps track of which CC values are possible
and uses this when inverting a mask.

Although this is mostly cosmestic, it fixes undefined behavior
for the CIJNLH in branch-08.ll.  Another fix would have been
to mask out bit 0 when generating the fused compare and branch,
but the point of this patch is that we shouldn't need to do that
in the first place.

The patch also makes it easier to reuse CC results from other instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187495 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-31 12:30:20 +00:00
..
Analysis Fix a severe compile time problem when forming large SCEV expressions. 2013-07-31 02:43:40 +00:00
AsmParser Target/X86: Add explicit Win64 and System V/x86-64 calling conventions. 2013-07-12 06:02:35 +00:00
Bitcode Make .bc en/decoding of AttrKind stable 2013-07-26 04:16:55 +00:00
CodeGen Fix crashing on invalid inline asm with matching constraints. 2013-07-31 01:26:24 +00:00
DebugInfo DebugInfo: Factor out parsing compile unit DIEs to a separate function. Improve code style and comments. 2013-07-15 08:43:35 +00:00
ExecutionEngine [PowerPC] Support powerpc64le as a syntax-checking target. 2013-07-26 01:35:43 +00:00
IR Add parentheses to silence gcc warning. 2013-07-31 04:07:28 +00:00
IRReader Add 'const' qualifiers to static const char* variables. 2013-07-16 01:17:10 +00:00
Linker Extend RemapInstruction and friends to take an optional new parameter, a ValueMaterializer. 2013-05-28 15:17:05 +00:00
MC MC: Support larger COFF string tables 2013-07-29 12:30:12 +00:00
Object Add support for the 's' operation to llvm-ar. 2013-07-29 12:40:31 +00:00
Option Silence gcc warning. 2013-07-22 21:29:28 +00:00
Support Fix windows' implementation of status when a file doesn't exist. 2013-07-31 00:10:25 +00:00
TableGen keep only the StringRef version of getFileOrSTDIN. 2013-06-25 05:28:34 +00:00
Target [SystemZ] Be more careful about inverting CC masks 2013-07-31 12:30:20 +00:00
Transforms Preserve fast-math flags when folding (fsub x, (fneg y)) to (fadd x, y). 2013-07-30 23:53:17 +00:00
CMakeLists.txt Move lib/Archive to tools/llvm-ar. 2013-06-17 15:47:20 +00:00
LLVMBuild.txt Move lib/Archive to tools/llvm-ar. 2013-06-17 15:47:20 +00:00
Makefile Move lib/Archive to tools/llvm-ar. 2013-06-17 15:47:20 +00:00