Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTe...
authorDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 13 Feb 2014 14:44:26 +0000 (14:44 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 13 Feb 2014 14:44:26 +0000 (14:44 +0000)
commit753e17629d3e5ee46ad2eb4d3827cf544eb6fd2e
treeeaaacae383f4a25a16d341c9bee55ed341e256f1
parent5cb24b8ca9eb82d883bf4cfcd79cf5a8c5e39e12
Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call

Summary:
AsmPrinter::EmitInlineAsm() will no longer use the EmitRawText() call for
targets with mature MC support. Such targets will always parse the inline
assembly (even when emitting assembly). Targets without mature MC support
continue to use EmitRawText() for assembly output.

The hasRawTextSupport() check in AsmPrinter::EmitInlineAsm() has been replaced
with MCAsmInfo::UseIntegratedAs which when true, causes the integrated assembler
to parse inline assembly (even when emitting assembly output). UseIntegratedAs
is set to true for targets that consider any failure to parse valid assembly
to be a bug. Target specific subclasses generally enable the integrated
assembler in their constructor. The default value can be overridden with
-no-integrated-as.

All tests that rely on inline assembly supporting invalid assembly (for example,
those that use mnemonics such as 'foo' or 'hello world') have been updated to
disable the integrated assembler.

Changes since review (and last commit attempt):
- Fixed test failures that were missed due to configuration of local build.
  (fixes crash.ll and a couple others).
- Fixed tests that happened to pass because the local build was on X86
  (should fix 2007-12-17-InvokeAsm.ll)
- mature-mc-support.ll's should no longer require all targets to be compiled.
  (should fix ARM and PPC buildbots)
- Object output (-filetype=obj and similar) now forces the integrated assembler
  to be enabled regardless of default setting or -no-integrated-as.
  (should fix SystemZ buildbots)

Reviewers: rafael

Reviewed By: rafael

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2686

llvm-svn: 201333
96 files changed:
clang/test/CodeGen/2010-06-17-asmcrash.c
clang/test/Frontend/backend-diagnostic.c
llvm/include/llvm/MC/MCAsmInfo.h
llvm/include/llvm/MC/MCObjectStreamer.h
llvm/include/llvm/MC/MCStreamer.h
llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
llvm/lib/CodeGen/LLVMTargetMachine.cpp
llvm/lib/MC/MCAsmInfo.cpp
llvm/lib/MC/MCAsmInfoCOFF.cpp
llvm/lib/MC/MCAsmInfoDarwin.cpp
llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h
llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp
llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
llvm/test/CodeGen/AArch64/inline-asm-constraints.ll
llvm/test/CodeGen/AArch64/inline-asm-modifiers.ll
llvm/test/CodeGen/AArch64/mature-mc-support.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/2009-04-06-AsmModifier.ll
llvm/test/CodeGen/ARM/arm-modifier.ll
llvm/test/CodeGen/ARM/crash-O0.ll
llvm/test/CodeGen/ARM/inlineasm-64bit.ll
llvm/test/CodeGen/ARM/inlineasm-imm-arm.ll
llvm/test/CodeGen/ARM/inlineasm3.ll
llvm/test/CodeGen/ARM/mature-mc-support.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/mult-alt-generic-arm.ll
llvm/test/CodeGen/ARM/subreg-remat.ll
llvm/test/CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll
llvm/test/CodeGen/Generic/2007-04-27-InlineAsm-X-Dest.ll
llvm/test/CodeGen/Generic/2007-04-27-LargeMemObject.ll
llvm/test/CodeGen/Generic/2007-12-17-InvokeAsm.ll
llvm/test/CodeGen/Generic/2008-02-20-MatchingMem.ll
llvm/test/CodeGen/Generic/asm-large-immediate.ll
llvm/test/CodeGen/Generic/inline-asm-mem-clobber.ll
llvm/test/CodeGen/Generic/inline-asm-special-strings.ll
llvm/test/CodeGen/Mips/mature-mc-support.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll
llvm/test/CodeGen/PowerPC/2007-05-03-InlineAsm-S-Constraint.ll
llvm/test/CodeGen/PowerPC/mature-mc-support.ll [new file with mode: 0644]
llvm/test/CodeGen/SPARC/mature-mc-support.ll [new file with mode: 0644]
llvm/test/CodeGen/SystemZ/mature-mc-support.ll [new file with mode: 0644]
llvm/test/CodeGen/Thumb/inlineasm-imm-thumb.ll
llvm/test/CodeGen/Thumb/mature-mc-support.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/2006-07-20-InlineAsm.ll
llvm/test/CodeGen/X86/2006-07-31-SingleRegClass.ll
llvm/test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll
llvm/test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll
llvm/test/CodeGen/X86/2007-10-28-inlineasm-q-modifier.ll
llvm/test/CodeGen/X86/2007-11-04-LiveVariablesBug.ll
llvm/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll
llvm/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll
llvm/test/CodeGen/X86/2008-02-26-AsmDirectMemOp.ll
llvm/test/CodeGen/X86/2008-04-26-Asm-Optimize-Imm.ll
llvm/test/CodeGen/X86/2008-09-18-inline-asm-2.ll
llvm/test/CodeGen/X86/2008-10-17-Asm64bitRConstraint.ll
llvm/test/CodeGen/X86/2008-10-20-AsmDoubleInI32.ll
llvm/test/CodeGen/X86/2009-02-12-InlineAsm-nieZ-constraints.ll
llvm/test/CodeGen/X86/2009-04-13-2AddrAssert-2.ll
llvm/test/CodeGen/X86/2009-05-08-InlineAsmIOffset.ll
llvm/test/CodeGen/X86/2009-09-19-earlyclobber.ll
llvm/test/CodeGen/X86/2009-12-01-EarlyClobberBug.ll
llvm/test/CodeGen/X86/2010-05-05-LocalAllocEarlyClobber.ll
llvm/test/CodeGen/X86/2010-06-15-FastAllocEarlyCLobber.ll
llvm/test/CodeGen/X86/2010-06-25-asm-RA-crash.ll
llvm/test/CodeGen/X86/2010-06-28-FastAllocTiedOperand.ll
llvm/test/CodeGen/X86/2010-06-28-matched-g-constraint.ll
llvm/test/CodeGen/X86/2010-07-02-asm-alignstack.ll
llvm/test/CodeGen/X86/2010-07-06-asm-RIP.ll
llvm/test/CodeGen/X86/2010-07-13-indirectXconstraint.ll
llvm/test/CodeGen/X86/2011-10-11-SpillDead.ll
llvm/test/CodeGen/X86/asm-block-labels.ll
llvm/test/CodeGen/X86/asm-global-imm.ll
llvm/test/CodeGen/X86/cas.ll
llvm/test/CodeGen/X86/crash.ll
llvm/test/CodeGen/X86/fast-isel.ll
llvm/test/CodeGen/X86/fold-xmm-zero.ll
llvm/test/CodeGen/X86/inline-asm-flag-clobber.ll
llvm/test/CodeGen/X86/inline-asm-fpstack.ll
llvm/test/CodeGen/X86/inline-asm-h.ll
llvm/test/CodeGen/X86/inline-asm-modifier-n.ll
llvm/test/CodeGen/X86/inline-asm-mrv.ll
llvm/test/CodeGen/X86/inline-asm-q-regs.ll
llvm/test/CodeGen/X86/inline-asm-stack-realign3.ll
llvm/test/CodeGen/X86/inline-asm-tied.ll
llvm/test/CodeGen/X86/inline-asm-x-scalar.ll
llvm/test/CodeGen/X86/inline-asm.ll
llvm/test/CodeGen/X86/mature-mc-support.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/ms-inline-asm.ll
llvm/test/CodeGen/X86/mult-alt-generic-i686.ll
llvm/test/CodeGen/X86/mult-alt-generic-x86_64.ll
llvm/test/CodeGen/X86/mult-alt-x86.ll
llvm/test/CodeGen/X86/multiple-loop-post-inc.ll
llvm/test/CodeGen/X86/opaque-constant-asm.ll
llvm/test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll