diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2019-03-14 23:14:31 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2019-03-14 23:14:31 +0000 |
| commit | 2c9275a79008807a5791d3fd0002887f329c5ac6 (patch) | |
| tree | 72f9b2661c22c181ddb58d09fae1147678c01da2 /llvm/test/Transforms/CodeGenPrepare | |
| parent | 96c1f2cd6c82de9816a0b7a1c1e1b2ea1caea4bc (diff) | |
| download | bcm5719-llvm-2c9275a79008807a5791d3fd0002887f329c5ac6.tar.gz bcm5719-llvm-2c9275a79008807a5791d3fd0002887f329c5ac6.zip | |
[CGP] add another bailout for degenerate code (PR41064)
This is almost the same as:
rL355345
...and should prevent any potential crashing from examples like:
https://bugs.llvm.org/show_bug.cgi?id=41064
...although the bug was masked by:
rL355823
...and I'm not sure how to repro the problem after that change.
llvm-svn: 356218
Diffstat (limited to 'llvm/test/Transforms/CodeGenPrepare')
| -rw-r--r-- | llvm/test/Transforms/CodeGenPrepare/X86/overflow-intrinsics.ll | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/Transforms/CodeGenPrepare/X86/overflow-intrinsics.ll b/llvm/test/Transforms/CodeGenPrepare/X86/overflow-intrinsics.ll index 9a0bf28cb9f..a9ec204f088 100644 --- a/llvm/test/Transforms/CodeGenPrepare/X86/overflow-intrinsics.ll +++ b/llvm/test/Transforms/CodeGenPrepare/X86/overflow-intrinsics.ll @@ -1,3 +1,4 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt -codegenprepare -S < %s | FileCheck %s ; RUN: opt -enable-debugify -codegenprepare -S < %s 2>&1 | FileCheck %s -check-prefix=DEBUG @@ -454,6 +455,26 @@ define void @foo() { unreachable } +; Similarly for usubo. + +define i1 @bar2() { +; CHECK-LABEL: @bar2( +; CHECK-NEXT: [[CMP:%.*]] = icmp eq i64 1, 0 +; CHECK-NEXT: ret i1 [[CMP]] +; + %cmp = icmp eq i64 1, 0 + ret i1 %cmp +} + +define i64 @foo2(i8 *%p) { +; CHECK-LABEL: @foo2( +; CHECK-NEXT: [[SUB:%.*]] = add nsw i64 1, -1 +; CHECK-NEXT: ret i64 [[SUB]] +; + %sub = add nsw i64 1, -1 + ret i64 %sub +} + ; Check that every instruction inserted by -codegenprepare has a debug location. ; DEBUG: CheckModuleDebugify: PASS |

