diff options
| author | Roman Lebedev <lebedev.ri@gmail.com> | 2019-07-23 12:42:41 +0000 |
|---|---|---|
| committer | Roman Lebedev <lebedev.ri@gmail.com> | 2019-07-23 12:42:41 +0000 |
| commit | 87fdcb8749681e39a03eb830ae881cec95150911 (patch) | |
| tree | 0b7c849b1d9d58364f48720370489b71fa39f151 /llvm/test/Transforms/SimplifyCFG | |
| parent | 743d45ee2536d80ecadcc78ba5fc042de3bb3749 (diff) | |
| download | bcm5719-llvm-87fdcb8749681e39a03eb830ae881cec95150911.tar.gz bcm5719-llvm-87fdcb8749681e39a03eb830ae881cec95150911.zip | |
[NFC][PhaseOredering][SimplifyCFG] Add more runlines to umul.with.overflow tests
This way it will be more obvious that the problem is both
in cost threshold and in hardcoded benefit check,
plus will show how the instsimplify cleans this all in the end.
llvm-svn: 366800
Diffstat (limited to 'llvm/test/Transforms/SimplifyCFG')
| -rw-r--r-- | llvm/test/Transforms/SimplifyCFG/unsigned-multiplication-will-overflow.ll | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/unsigned-multiplication-will-overflow.ll b/llvm/test/Transforms/SimplifyCFG/unsigned-multiplication-will-overflow.ll index 0c02fba2ec9..ce0c8296d07 100644 --- a/llvm/test/Transforms/SimplifyCFG/unsigned-multiplication-will-overflow.ll +++ b/llvm/test/Transforms/SimplifyCFG/unsigned-multiplication-will-overflow.ll @@ -1,23 +1,25 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt < %s -simplifycfg -S | FileCheck %s +; RUN: opt < %s -simplifycfg -S | FileCheck %s --check-prefixes=ALL,DEFAULT,FALLBACK0 +; RUN: opt < %s -simplifycfg -phi-node-folding-threshold=2 -S | FileCheck %s --check-prefixes=ALL,DEFAULT,FALLBACK1 +; RUN: opt < %s -simplifycfg -phi-node-folding-threshold=3 -S | FileCheck %s --check-prefixes=ALL,COSTLY ; This is checking that the multiplication does overflow, with a leftover ; guard against division-by-zero that was needed before InstCombine ; produced llvm.umul.with.overflow. define i1 @will_overflow(i64 %size, i64 %nmemb) { -; CHECK-LABEL: @will_overflow( -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i64 [[SIZE:%.*]], 0 -; CHECK-NEXT: br i1 [[CMP]], label [[LAND_END:%.*]], label [[LAND_RHS:%.*]] -; CHECK: land.rhs: -; CHECK-NEXT: [[UMUL:%.*]] = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 [[SIZE]], i64 [[NMEMB:%.*]]) -; CHECK-NEXT: [[UMUL_OV:%.*]] = extractvalue { i64, i1 } [[UMUL]], 1 -; CHECK-NEXT: [[UMUL_NOT_OV:%.*]] = xor i1 [[UMUL_OV]], true -; CHECK-NEXT: br label [[LAND_END]] -; CHECK: land.end: -; CHECK-NEXT: [[TMP0:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[UMUL_NOT_OV]], [[LAND_RHS]] ] -; CHECK-NEXT: ret i1 [[TMP0]] +; ALL-LABEL: @will_overflow( +; ALL-NEXT: entry: +; ALL-NEXT: [[CMP:%.*]] = icmp eq i64 [[SIZE:%.*]], 0 +; ALL-NEXT: br i1 [[CMP]], label [[LAND_END:%.*]], label [[LAND_RHS:%.*]] +; ALL: land.rhs: +; ALL-NEXT: [[UMUL:%.*]] = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 [[SIZE]], i64 [[NMEMB:%.*]]) +; ALL-NEXT: [[UMUL_OV:%.*]] = extractvalue { i64, i1 } [[UMUL]], 1 +; ALL-NEXT: [[UMUL_NOT_OV:%.*]] = xor i1 [[UMUL_OV]], true +; ALL-NEXT: br label [[LAND_END]] +; ALL: land.end: +; ALL-NEXT: [[TMP0:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[UMUL_NOT_OV]], [[LAND_RHS]] ] +; ALL-NEXT: ret i1 [[TMP0]] ; entry: %cmp = icmp eq i64 %size, 0 |

