[PATCH] D69349: [InlineCost] Fix infinite loop in indirect call evaluation

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 12 04:16:24 PST 2019


fedor.sergeev added a comment.

Can you add a test similar to what you have here that excercises indirect call through a parameter?
Say, do

  define void @func1() {
    %t = bitcast void ()* @func3 to void ()*
    tail call void @func2(void()* %t)
    ret void
  }
  define void @func2(void()* %f) {
    tail call void %f()
    ret void
  }

and then......

  define void @func6() {
    %t2 = bitcast void (void()*)* @func2 to void (void()*)* 
    %t3 = bitcast void ()* @func3 to void ()*
    tail call void %t2(void()* %t3)
    ret void
  }

This results in recursive call to func2+ and your fix should handle it just right.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69349





More information about the llvm-commits mailing list