summaryrefslogtreecommitdiff
path: root/test/CodeGen/SystemZ/cond-store-05.ll
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-07-31 12:30:20 +0000
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-07-31 12:30:20 +0000
commit6824f127f90197b26af93cf5d6c13b7941567e54 (patch)
treed5108ab426eae97930ad3b1bbd034fe0802403d8 /test/CodeGen/SystemZ/cond-store-05.ll
parent0416e3c599c22dc656a1115ac983116ad0b2d9da (diff)
downloadllvm-6824f127f90197b26af93cf5d6c13b7941567e54.tar.gz
llvm-6824f127f90197b26af93cf5d6c13b7941567e54.tar.bz2
llvm-6824f127f90197b26af93cf5d6c13b7941567e54.tar.xz
[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
Diffstat (limited to 'test/CodeGen/SystemZ/cond-store-05.ll')
-rw-r--r--test/CodeGen/SystemZ/cond-store-05.ll4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/CodeGen/SystemZ/cond-store-05.ll b/test/CodeGen/SystemZ/cond-store-05.ll
index 131d1020cc..e41c8fe4f6 100644
--- a/test/CodeGen/SystemZ/cond-store-05.ll
+++ b/test/CodeGen/SystemZ/cond-store-05.ll
@@ -24,7 +24,7 @@ define void @f1(float *%ptr, float %alt, i32 %limit) {
define void @f2(float *%ptr, float %alt, i32 %limit) {
; CHECK-LABEL: f2:
; CHECK-NOT: %r2
-; CHECK: jnl [[LABEL:[^ ]*]]
+; CHECK: jhe [[LABEL:[^ ]*]]
; CHECK-NOT: %r2
; CHECK: ste %f0, 0(%r2)
; CHECK: [[LABEL]]:
@@ -179,7 +179,7 @@ define void @f10(float *%ptr, float %alt, i32 %limit) {
; ...likewise stores. In this case we should have a conditional load into %f0.
define void @f11(float *%ptr, float %alt, i32 %limit) {
; CHECK-LABEL: f11:
-; CHECK: jnl [[LABEL:[^ ]*]]
+; CHECK: jhe [[LABEL:[^ ]*]]
; CHECK: le %f0, 0(%r2)
; CHECK: [[LABEL]]:
; CHECK: ste %f0, 0(%r2)