[PATCH] D78341: Change callbr to only define its output SSA variable on the normal path, not the indirect targets.

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 16:25:31 PDT 2020


nickdesaulniers added a comment.

Thanks! My test case from the kernel now builds with Diff 258438.  Tests in tree pass, but with some additional test cases added in this CL, I'd be very happy to approve.  Thanks @jyknight!

The only other thing of note: this patch changes the other error I'm tracking for "asm goto with outputs." https://reviews.llvm.org/D77849.  I have assertions I'm working on in https://reviews.llvm.org/D78166 and https://reviews.llvm.org/D78234.  With this change applied though, I instead hit the assertion:

  clang-11: ../lib/CodeGen/InlineSpiller.cpp:1194: bool (anonymous namespace)::HoistSpillHelper::isSpillCandBB(llvm::LiveInterval &, llvm::VNInfo &, llvm::MachineBasicBlock &, unsigned int &): Assertion `OrigLI.getVNInfoAt(Idx) == &OrigVNI && "Unexpected VNI"' failed.

I suspect it's the same issue; but I could creduce the input (same file and pass, but different function).  Either way, I'd rather take this patch, and follow up on that.  Just making a note of a bunch of related CLs.



================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:225
   if (I->getParent() == &I->getFunction()->getEntryBlock() &&
-      !isa<InvokeInst>(I))
+      !isa<InvokeInst>(I) && !isa<CallbrInst>(I))
     return true;
----------------
```
../lib/Analysis/InstructionSimplify.cpp:225:35: error: unknown type name 'CallbrInst'; did you mean 'CallBrInst'?
      !isa<InvokeInst>(I) && !isa<CallbrInst>(I))
                                  ^~~~~~~~~~
                                  CallBrInst
../include/llvm/IR/Instruction.def:137:40: note: 'CallBrInst' declared here
HANDLE_TERM_INST  (11, CallBr        , CallBrInst) // A call-site terminator
                                       ^
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78341





More information about the llvm-commits mailing list