1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/lib/IR
Bill Wendling ffaf238dd0 Allow "callbr" to return non-void values
Summary:
Terminators in LLVM aren't prohibited from returning values. This means that
the "callbr" instruction, which is used for "asm goto", can support "asm goto
with outputs."

This patch removes all restrictions against "callbr" returning values. The
heavy lifting is done by the code generator. The "INLINEASM_BR" instruction's
a terminator, and the code generator doesn't allow non-terminator instructions
after a terminator. In order to correctly model the feature, we need to copy
outputs from "INLINEASM_BR" into virtual registers. Of course, those copies
aren't terminators.

To get around this issue, we split the block containing the "INLINEASM_BR"
right before the "COPY" instructions. This results in two cheats:

  - Any physical registers defined by "INLINEASM_BR" need to be marked as
    live-in into the block with the "COPY" instructions. This violates an
    assumption that physical registers aren't marked as "live-in" until after
    register allocation. But it seems as if the live-in information only
    needs to be correct after register allocation. So we're able to get away
    with this.

  - The indirect branches from the "INLINEASM_BR" are moved to the "COPY"
    block. This is to satisfy PHI nodes.

I've been told that MLIR can support this handily, but until we're able to
use it, we'll have to stick with the above.

Reviewers: jyknight, nickdesaulniers, hfinkel, MaskRay, lattner

Reviewed By: nickdesaulniers, MaskRay, lattner

Subscribers: rriddle, qcolombet, jdoerfert, MatzeB, echristo, MaskRay, xbolva00, aaron.ballman, cfe-commits, JonChesterfield, hiraditya, llvm-commits, rnk, craig.topper

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D69868
2020-02-24 18:29:06 -08:00
..
AbstractCallSite.cpp [Attributor] Use abstract call sites to determine associated arguments 2019-12-31 01:33:22 -06:00
AsmWriter.cpp [Assembler] Emit summary index flags 2020-02-18 17:49:54 +03:00
AttributeImpl.h [NFC] Factor out function to detect if an attribute has an argument. 2020-02-03 22:27:24 +01:00
Attributes.cpp [NFC] Factor out function to detect if an attribute has an argument. 2020-02-03 22:27:24 +01:00
AutoUpgrade.cpp [X86] Add back fmaddsub intrinsics to work towards fixing the strict fp implementation 2020-02-24 12:07:21 -08:00
BasicBlock.cpp [IR] Update BasicBlock::validateInstrOrdering comments, NFC 2020-02-21 12:33:16 -08:00
CMakeLists.txt [Remarks] Extend the RemarkStreamer to support other emitters 2020-02-04 17:16:02 -08:00
Comdat.cpp
ConstantFold.cpp [ConstantFold] fold fsub -0.0, undef to undef rather than NaN 2020-02-21 08:03:19 -05:00
ConstantFold.h Add FNeg IR constant folding support 2019-05-05 16:07:09 +00:00
ConstantRange.cpp [ConstantRange] Respect destination bitwidth for cast results. 2019-12-27 17:38:34 +00:00
Constants.cpp [NFC] Remove trailing space 2020-02-18 10:49:13 +08:00
ConstantsContext.h Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Core.cpp [NFC] Remove trailing space 2020-02-18 10:49:13 +08:00
DataLayout.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
DebugInfo.cpp [DebugInfo] Merge DebugInfoFinder::{processDeclare,processValue} into processVariable 2020-02-01 23:00:21 -08:00
DebugInfoMetadata.cpp Move the sysroot attribute from DIModule to DICompileUnit 2020-01-17 12:55:40 -08:00
DebugLoc.cpp
DiagnosticHandler.cpp
DiagnosticInfo.cpp [NFC] Remove trailing space 2020-02-18 10:49:13 +08:00
DiagnosticPrinter.cpp
DIBuilder.cpp [IRBuilder] Delete copy constructor 2020-02-17 18:14:48 +01:00
Dominators.cpp [Dominators] Use Instruction::comesBefore for block-local queries, NFC 2020-02-20 16:41:51 -08:00
FPEnv.cpp Add missing newlines at EOF; NFC 2020-02-12 15:57:25 +00:00
Function.cpp Add <128 x i1> as an intrinsic type 2020-02-19 09:38:13 -06:00
Globals.cpp Implement -fsemantic-interposition 2020-01-31 14:02:33 +01:00
GVMaterializer.cpp
InlineAsm.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Instruction.cpp [IR] Lazily number instructions for local dominance queries 2020-02-18 14:44:24 -08:00
Instructions.cpp Reapply: [SVE] Fix bug in simplification of scalable vector instructions 2020-02-05 10:00:09 -08:00
IntrinsicInst.cpp [FPEnv] Divide macro INSTRUCTION into INSTRUCTION and DAG_INSTRUCTION, 2020-01-27 10:38:05 +08:00
IRBuilder.cpp Reapply [IRBuilder] Always respect inserter/folder 2020-02-19 20:51:38 +01:00
IRPrintingPasses.cpp [PassInstrumentation] Remove excess newline for the new pass manager 2019-11-28 17:20:17 -08:00
LegacyPassManager.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
LLVMBuild.txt [Remarks] Add string deduplication using a string table 2019-04-24 00:06:24 +00:00
LLVMContext.cpp [Remarks] Fix gcc build 2020-02-04 17:43:59 -08:00
LLVMContextImpl.cpp Make dropTriviallyDeadConstantArrays not quadratic 2020-01-21 16:06:46 +01:00
LLVMContextImpl.h [Remarks] Fix gcc build 2020-02-04 17:43:59 -08:00
LLVMRemarkStreamer.cpp Revert "Remove redundant "std::move"s in return statements" 2020-02-10 07:07:40 -08:00
Mangler.cpp Standardize on MSVC behavior for triples with no environment 2019-07-08 21:05:20 +00:00
MDBuilder.cpp Reland "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM" 2019-09-11 16:19:50 +00:00
Metadata.cpp [WPD/VFE] Always emit vcall_visibility metadata for -fwhole-program-vtables 2020-01-23 11:36:01 -08:00
MetadataImpl.h
Module.cpp RNG: Take pass name as argument instead of pass pointer. 2020-01-31 14:21:40 -05:00
ModuleSummaryIndex.cpp [Assembler] Emit summary index flags 2020-02-18 17:49:54 +03:00
Operator.cpp
OptBisect.cpp
Pass.cpp [LegacyPassManager] Delete BasicBlockPass/Manager. 2019-10-30 11:40:16 -07:00
PassInstrumentation.cpp
PassManager.cpp Add PassManagerImpl.h to hide implementation details 2020-02-03 11:15:55 -08:00
PassRegistry.cpp
PassTimingInfo.cpp [Legacy][TimePasses] allow -time-passes reporting into a custom stream 2019-03-22 23:11:08 +00:00
ProfileSummary.cpp [PGO] Context sensitive PGO (part 2) 2019-02-28 19:55:07 +00:00
SafepointIRVerifier.cpp [Support] Split MallocAllocator out of Allocator.h 2020-01-24 17:29:32 -08:00
Statepoint.cpp
SymbolTableListTraitsImpl.h [IR] Lazily number instructions for local dominance queries 2020-02-18 14:44:24 -08:00
Type.cpp [SVE][IR] Scalable Vector size queries and IR instruction support 2019-10-08 12:53:54 +00:00
TypeFinder.cpp [NFC] Fixes -Wrange-loop-analysis warnings 2020-01-01 20:01:37 +01:00
Use.cpp
User.cpp Reinstate MSan suppression of PR24578. 2019-11-22 11:25:24 -08:00
Value.cpp Fix MSAN failure on Function destruction 2020-02-06 15:09:58 -08:00
ValueSymbolTable.cpp
Verifier.cpp Allow "callbr" to return non-void values 2020-02-24 18:29:06 -08:00