diff options
| author | Johannes Doerfert <jdoerfert@anl.gov> | 2019-08-21 21:48:56 +0000 |
|---|---|---|
| committer | Johannes Doerfert <jdoerfert@anl.gov> | 2019-08-21 21:48:56 +0000 |
| commit | d98f975089e3dd8a2a0dc298d3f76b0463610d2c (patch) | |
| tree | 49d900d18ace46be09151c2d0e83059b2a701a18 /llvm/lib/Transforms | |
| parent | bf9ee07afa3f1a15277018f60787a1a205ec08d8 (diff) | |
| download | bcm5719-llvm-d98f975089e3dd8a2a0dc298d3f76b0463610d2c.tar.gz bcm5719-llvm-d98f975089e3dd8a2a0dc298d3f76b0463610d2c.zip | |
[Attributor] Fix: Gracefully handle non-instruction users
Function can have users that are not instructions, e.g., bitcasts. For
now, we simply give up when we see them.
llvm-svn: 369588
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/IPO/Attributor.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp index 71daf79a04d..6caa0275c7d 100644 --- a/llvm/lib/Transforms/IPO/Attributor.cpp +++ b/llvm/lib/Transforms/IPO/Attributor.cpp @@ -2321,7 +2321,11 @@ bool Attributor::checkForAllCallSites(const function_ref<bool(CallSite)> &Pred, } for (const Use &U : AssociatedFunction->uses()) { - Instruction *I = cast<Instruction>(U.getUser()); + Instruction *I = dyn_cast<Instruction>(U.getUser()); + // TODO: Deal with abstract call sites here. + if (!I) + return false; + Function *Caller = I->getFunction(); const auto &LivenessAA = |

