[PATCH] D68633: [utils] InlineFunction: fix for debug info affecting optimizations

Chris Ye via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 03:04:14 PDT 2019


yechunliang updated this revision to Diff 225583.
yechunliang added a comment.

just added use_empty check in the inner loop, this will be the smallest code change for issue fixing.

[InlineFunction] skip use_empty allocas when inline

  
  Add use_empty check in alloca inner loop scanning, if the alloca is use_empty, do not move it to the entry block of the caller, stop scanning and goto splice immediately.
  
  the behavior should be like this:
    a) the callee:
      %a = alloca (is !use_empty)
      %b = alloca (is use_empty)
      %c = alloca (is !use_empty)
  
    b) the caller after inline: (instr %b is skipped)
      %a = alloca (is !use_empty)
      %c = alloca (is !use_empty)
  
  Fix the issue: https://bugs.llvm.org/show_bug.cgi?id=43291


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68633/new/

https://reviews.llvm.org/D68633

Files:
  llvm/lib/Transforms/Utils/InlineFunction.cpp
  llvm/test/Transforms/Inline/inline-skip-use-empty-alloca.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68633.225583.patch
Type: text/x-patch
Size: 5371 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191018/9359a398/attachment.bin>


More information about the llvm-commits mailing list