diff options
| author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-12-19 22:40:28 +0000 |
|---|---|---|
| committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-12-19 22:40:28 +0000 |
| commit | ab0626e35f2bf7cde2d51ffd9bf20810404d7f0f (patch) | |
| tree | 7471c21925b545cd136f0fd1344e552f77103afb /llvm/test/Transforms | |
| parent | b496834f8e4349bce6cbff390b0f72ac9b41164c (diff) | |
| download | bcm5719-llvm-ab0626e35f2bf7cde2d51ffd9bf20810404d7f0f.tar.gz bcm5719-llvm-ab0626e35f2bf7cde2d51ffd9bf20810404d7f0f.zip | |
Nonnull elements in OperandBundleCallSites are not all Instructions
`CloneAndPruneIntoFromInst` sometimes RAUW's dead instructions with
`undef` before erasing them (to avoid deleting instructions that still
have uses). This changes the `WeakVH` in `OperandBundleCallSites` to
hold an `undef`, and we need to guard for this situation in eventuality
in `llvm::InlineFunction`.
llvm-svn: 256110
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/Inline/deopt-bundles.ll | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/Transforms/Inline/deopt-bundles.ll b/llvm/test/Transforms/Inline/deopt-bundles.ll index 1acbb2f0585..3e3c52f7d2d 100644 --- a/llvm/test/Transforms/Inline/deopt-bundles.ll +++ b/llvm/test/Transforms/Inline/deopt-bundles.ll @@ -162,6 +162,42 @@ define i32 @caller_7() { ret i32 %x } +define i32 @callee_8(i1 %val) alwaysinline personality i8 3 { +; We want something that PruningFunctionCloner is not smart enough to +; recognize, but can be recognized by recursivelySimplifyInstruction. + + entry: + br i1 %val, label %check, label %precheck + + precheck: + br label %check + + check: + %p = phi i1 [ %val, %entry ], [ true, %precheck ] + br i1 %p, label %do.not, label %do + + do.not: + ret i32 0 + + do: + %phi = phi i32 [ 0, %check ], [ %v, %do ] + %v = call fastcc i32 @g.fastcc() [ "deopt"(i32 0, i32 1), "foo"(double 0.0) ] + %ic = icmp eq i32 %v, 42 + br i1 %ic, label %do, label %done + + done: + ret i32 %phi +} + +define i32 @caller_8() { +; CHECK-LABEL: @caller_8( + entry: +; CHECK-NOT: call fastcc i32 @g.fastcc() +; CHECK: ret i32 0 + %x = call i32 @callee_8(i1 true) [ "deopt"(i32 7) ] + ret i32 %x +} + attributes #0 = { "foo"="bar" } ; CHECK: attributes #[[FOO_BAR_ATTR_IDX]] = { "foo"="bar" } |

