[PATCH] D37894: [Lint] Avoid failed assertion by fetching the proper pointer type

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 02:52:11 PDT 2017


uabelho updated this revision to Diff 115614.
uabelho edited the summary of this revision.
uabelho added a comment.

Pass DataLayout to isNoopCast when called from lint.

Question:
In FastISel::hasTrivialKill there is:

  // No-op casts are trivially coalesced by fast-isel.
  if (const auto *Cast = dyn_cast<CastInst>(I))
    if (Cast->isNoopCast(DL.getIntPtrType(Cast->getContext())) &&

Do you know if it is ok to change this isNoopCast call to Cast->isNoopCast(DL)?

If so, then I can clean up the patch further by removing the IntPtrTy versions completely.


https://reviews.llvm.org/D37894

Files:
  include/llvm/IR/InstrTypes.h
  lib/Analysis/Lint.cpp
  lib/IR/Instructions.cpp
  test/Analysis/Lint/noop-cast-expr-no-pointer.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37894.115614.patch
Type: text/x-patch
Size: 3701 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170918/9dc9dbe9/attachment.bin>


More information about the llvm-commits mailing list