diff options
author | Nirav Dave <niravd@google.com> | 2019-01-24 17:56:03 +0000 |
---|---|---|
committer | Nirav Dave <niravd@google.com> | 2019-01-24 17:56:03 +0000 |
commit | 58e9833e980e07f9ca4407d703417eecde4dc541 (patch) | |
tree | 93a635d6f5910d9b1ca2e714adc5dc4c5989f37c /llvm/lib/CodeGen | |
parent | b41a1984728725e955d7a4d9e8a8cfda7f40640c (diff) | |
download | bcm5719-llvm-58e9833e980e07f9ca4407d703417eecde4dc541.tar.gz bcm5719-llvm-58e9833e980e07f9ca4407d703417eecde4dc541.zip |
[SelectionDAGBuilder] Simplify HasSideEffect calculation. NFC.
llvm-svn: 352067
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 664cc3b9900..7244aacbf26 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -7505,9 +7505,9 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) { TargetLowering::AsmOperandInfoVector TargetConstraints = TLI.ParseConstraints( DAG.getDataLayout(), DAG.getSubtarget().getRegisterInfo(), CS); - bool hasMemory = false; - - // Remember the HasSideEffect, AlignStack, AsmDialect, MayLoad and MayStore + // First Pass: Calculate HasSideEffects and ExtraFlags (AlignStack, + // AsmDialect, MayLoad, MayStore). + bool HasSideEffect = IA->hasSideEffects(); ExtraFlags ExtraInfo(CS); unsigned ArgNo = 0; // ArgNo - The argument of the CallInst. @@ -7550,8 +7550,8 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) { OpInfo.ConstraintVT = MVT::Other; } - if (!hasMemory) - hasMemory = OpInfo.hasMemory(TLI); + if (!HasSideEffect) + HasSideEffect = OpInfo.hasMemory(TLI); // Determine if this InlineAsm MayLoad or MayStore based on the constraints. // FIXME: Could we compute this on OpInfo rather than T? @@ -7562,14 +7562,9 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) { ExtraInfo.update(T); } - SDValue Chain, Flag; - // We won't need to flush pending loads if this asm doesn't touch // memory and is nonvolatile. - if (hasMemory || IA->hasSideEffects()) - Chain = getRoot(); - else - Chain = DAG.getRoot(); + SDValue Flag, Chain = (HasSideEffect) ? getRoot() : DAG.getRoot(); // Second pass over the constraints: compute which constraint option to use. for (SDISelAsmOperandInfo &OpInfo : ConstraintOperands) { @@ -7925,8 +7920,7 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) { Chain = DAG.getNode(ISD::TokenFactor, getCurSDLoc(), MVT::Other, OutChains); // Only Update Root if inline assembly has a memory effect. - if (ResultValues.empty() || IA->hasSideEffects() || hasMemory || - !OutChains.empty()) + if (ResultValues.empty() || HasSideEffect || !OutChains.empty()) DAG.setRoot(Chain); } |