diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2019-10-14 12:22:48 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2019-10-14 12:22:48 +0000 |
commit | 1a21f98ac3c57d027908000b8bac356daec51416 (patch) | |
tree | 9ed8a7cdea6b2580e007cf82401073f4ffff08ba /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | c4d256a59049d4b2f21da83f43b9caba2427885e (diff) | |
download | bcm5719-llvm-1a21f98ac3c57d027908000b8bac356daec51416.tar.gz bcm5719-llvm-1a21f98ac3c57d027908000b8bac356daec51416.zip |
Revert "Add a pass to lower is.constant and objectsize intrinsics"
This reverts commit r374743. It broke the build with Ocaml enabled:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19218
llvm-svn: 374768
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 061c8e51a99..0594d5fe1b1 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -1868,10 +1868,24 @@ bool CodeGenPrepare::optimizeCallInst(CallInst *CI, bool &ModifiedDT) { }); return true; } - case Intrinsic::objectsize: - llvm_unreachable("llvm.objectsize.* should have been lowered already"); - case Intrinsic::is_constant: - llvm_unreachable("llvm.is.constant.* should have been lowered already"); + case Intrinsic::objectsize: { + // Lower all uses of llvm.objectsize.* + Value *RetVal = + lowerObjectSizeCall(II, *DL, TLInfo, /*MustSucceed=*/true); + + resetIteratorIfInvalidatedWhileCalling(BB, [&]() { + replaceAndRecursivelySimplify(CI, RetVal, TLInfo, nullptr); + }); + return true; + } + case Intrinsic::is_constant: { + // If is_constant hasn't folded away yet, lower it to false now. + Constant *RetVal = ConstantInt::get(II->getType(), 0); + resetIteratorIfInvalidatedWhileCalling(BB, [&]() { + replaceAndRecursivelySimplify(CI, RetVal, TLInfo, nullptr); + }); + return true; + } case Intrinsic::aarch64_stlxr: case Intrinsic::aarch64_stxr: { ZExtInst *ExtVal = dyn_cast<ZExtInst>(CI->getArgOperand(0)); |