summaryrefslogtreecommitdiff
path: root/test/CodeGen/PowerPC/testCompareslllesi.ll
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2017-08-14 03:41:00 +0000
committerChandler Carruth <chandlerc@gmail.com>2017-08-14 03:41:00 +0000
commit2de896abcee5804f9573c358763fbf5cb5b3899a (patch)
tree3fc690ea870a4b69c67b14271269a2b27a5aefdf /test/CodeGen/PowerPC/testCompareslllesi.ll
parenteab92f74e7d58af2ee7c59a8b02535d6d655b021 (diff)
[PowerPC] Revert r310346 (and followups r310356 & r310424) which
introduce a miscompile bug. There appears to be a bug where the generated code to extract the sign bit doesn't work correctly for 32-bit inputs. I've replied to the original commit pointing out the problem. I think I see by inspection (and reading the manual for PPC) how to fix this, but I can't be 100% confident and I also don't know what the best way to test this is. Currently it seems nearly impossible to get the backend to hit this code path, but the patch autohr is likely in a better position to craft such test cases than I am, and based on where the bug is it should be easily done. Original commit message for r310346: """ [PowerPC] Eliminate compares - add i32 sext/zext handling for SETLE/SETGE Adds handling for SETLE/SETGE comparisons on i32 values. Furthermore, it adds the handling for the special case where RHS == 0. Differential Revision: https://reviews.llvm.org/D34048 """ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310809 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PowerPC/testCompareslllesi.ll')
-rw-r--r--test/CodeGen/PowerPC/testCompareslllesi.ll69
1 files changed, 0 insertions, 69 deletions
diff --git a/test/CodeGen/PowerPC/testCompareslllesi.ll b/test/CodeGen/PowerPC/testCompareslllesi.ll
deleted file mode 100644
index c8ae990e8dc..00000000000
--- a/test/CodeGen/PowerPC/testCompareslllesi.ll
+++ /dev/null
@@ -1,69 +0,0 @@
-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \
-; RUN: -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
-; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl
-; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \
-; RUN: -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
-; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-
-@glob = common local_unnamed_addr global i32 0, align 4
-
-define i64 @test_lllesi(i32 signext %a, i32 signext %b) {
-; CHECK-LABEL: test_lllesi:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: subf r3, r3, r4
-; CHECK-NEXT: rldicl r3, r3, 1, 63
-; CHECK-NEXT: xori r3, r3, 1
-; CHECK-NEXT: blr
-entry:
- %cmp = icmp sle i32 %a, %b
- %conv1 = zext i1 %cmp to i64
- ret i64 %conv1
-}
-
-define i64 @test_lllesi_sext(i32 signext %a, i32 signext %b) {
-; CHECK-LABEL: test_lllesi_sext:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: subf r3, r3, r4
-; CHECK-NEXT: rldicl r3, r3, 1, 63
-; CHECK-NEXT: addi r3, r3, -1
-; CHECK-NEXT: blr
-entry:
- %cmp = icmp sle i32 %a, %b
- %conv1 = sext i1 %cmp to i64
- ret i64 %conv1
-}
-
-define void @test_lllesi_store(i32 signext %a, i32 signext %b) {
-; CHECK-LABEL: test_lllesi_store:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: addis r5, r2, .LC0@toc@ha
-; CHECK-NEXT: subf r3, r3, r4
-; CHECK-NEXT: ld r12, .LC0@toc@l(r5)
-; CHECK-NEXT: rldicl r3, r3, 1, 63
-; CHECK-NEXT: xori r3, r3, 1
-; CHECK-NEXT: stw r3, 0(r12)
-; CHECK-NEXT: blr
-entry:
- %cmp = icmp sle i32 %a, %b
- %conv = zext i1 %cmp to i32
- store i32 %conv, i32* @glob, align 4
- ret void
-}
-
-define void @test_lllesi_sext_store(i32 signext %a, i32 signext %b) {
-; CHECK-LABEL: test_lllesi_sext_store:
-; CHECK: # BB#0: # %entry
-; CHECK-NEXT: addis r5, r2, .LC0@toc@ha
-; CHECK-NEXT: subf r3, r3, r4
-; CHECK-NEXT: ld r12, .LC0@toc@l(r5)
-; CHECK-NEXT: rldicl r3, r3, 1, 63
-; CHECK-NEXT: addi r3, r3, -1
-; CHECK-NEXT: stw r3, 0(r12)
-; CHECK-NEXT: blr
-entry:
- %cmp = icmp sle i32 %a, %b
- %sub = sext i1 %cmp to i32
- store i32 %sub, i32* @glob, align 4
- ret void
-}