Commit Graph

132635 Commits

Author SHA1 Message Date
Ted Kremenek f9a539d858 Automatically use more cores when the test build uses 'make'.
llvm-svn: 162790
2012-08-28 20:40:04 +00:00
Ted Kremenek 42c14428d2 Consolidate helper methods and configuration logic. No functionality change.
llvm-svn: 162789
2012-08-28 20:40:02 +00:00
Peter Collingbourne c6b0857e95 CUDA: give static storage class to __shared__ and __constant__
variables without a storage class within a function, to implement
CUDA B.2.5: "__shared__ and __constant__ variables have implied static
storage [duration]."

llvm-svn: 162788
2012-08-28 20:37:50 +00:00
Peter Collingbourne ee0502d551 CUDA: give correct address space to globals declared in functions
llvm-svn: 162787
2012-08-28 20:37:10 +00:00
Chad Rosier 7ae6360758 Tidy up.
llvm-svn: 162786
2012-08-28 20:35:06 +00:00
Chad Rosier 0bca469d11 [ms-inline asm] Have generateAsmString() return the AsmString computed by Sema.
We still need to translate the string, but this at least gets us one step
closer to using the more general EmitAsmStmt() codegen function. No functional
change intended.

llvm-svn: 162785
2012-08-28 20:33:49 +00:00
Chad Rosier 3dd7bf2c86 [ms-inline asm] Add constraints to MSAsmStmt. We don't currently compute
the constraints, so in the interim we speculatively assume a 'r' constraint.
This is expected to work for most cases on x86.

llvm-svn: 162784
2012-08-28 20:28:20 +00:00
Ted Kremenek 6cb2080e5e Pass --use-analyzer to scan-build when running within the test harness.
llvm-svn: 162783
2012-08-28 20:20:52 +00:00
Jack Carter cd6b0e1368 The instruction DEXT may be transformed into DEXTU or DEXTM depending
on the size of the extraction and its position in the 64 bit word.

This patch allows support of the dext transformations with mips64 direct
object output.

0 <= msb < 32 0 <= lsb < 32 0 <= pos < 32 1 <= size <= 32
DINS
The field is entirely contained in the right-most word of the doubleword

32 <= msb < 64 0 <= lsb < 32 0 <= pos < 32 2 <= size <= 64
DINSM
The field straddles the words of the doubleword

32 <= msb < 64 32 <= lsb < 64 32 <= pos < 64 1 <= size <= 32
DINSU
The field is entirely contained in the left-most word of the doubleword

llvm-svn: 162782
2012-08-28 20:07:41 +00:00
Jack Carter 551efd7fd9 Some of the instructions in the Mips instruction set are revision
delimited. llvm-mc -disassemble access these through the -mattr
option.

llvm-objdump -disassemble had no such way to set the attribute so
some instructions were just not recognized for disassembly.

This patch accepts llvm-mc mechanism for specifying the attributes.

llvm-svn: 162781
2012-08-28 19:24:49 +00:00
Michael Liao 710e1a594b Explicitly update the number of nodes to be traversed
llvm-svn: 162780
2012-08-28 19:20:29 +00:00
Jack Carter c20a21b855 Some instructions are passed to the assembler to be
transformed to the final instruction variant. An
example would be dsrll which is transformed into 
dsll32 if the shift value is greater than 32.

For direct object output we need to do this transformation
in the codegen. If the instruction was inside branch
delay slot, it was being missed. This patch corrects this
oversight.

llvm-svn: 162779
2012-08-28 19:07:39 +00:00
Roman Divacky 8c4b6a307e Emit word of zeroes after the last instruction as a start of the mandatory
traceback table on PowerPC64. This helps gdb handle exceptions. The other
mandatory fields are ignored by gdb and harder to implement so just add
there a FIXME.

Patch by Bill Schmidt. PR13641.

llvm-svn: 162778
2012-08-28 19:06:55 +00:00
Akira Hatanaka 206cefe66c Follow-up patch to r162731.
Fix a couple of bugs in mips' long branch pass.
This patch was supposed to be committed along with r162731, so I don't have a
new test case.

llvm-svn: 162777
2012-08-28 18:58:57 +00:00
Chad Rosier 6051bb94c0 [ms-inline asm] Rename EmitGCCAsmStmt to EmitAsmStmt and have it accept
AsmStmts.  This function is only used by GCCAsmStmts, however. Constraints need
to be properly computed before MSAsmStmts can use EmitAsmStmt.  No functional
change intended.

llvm-svn: 162776
2012-08-28 18:54:39 +00:00
Ted Kremenek 4220144acb experimental.security.taint is now alpha.security.taint
llvm-svn: 162775
2012-08-28 18:45:22 +00:00
Jakob Stoklund Olesen e56c60c5eb Add a MachineOperand::isTied() flag.
While in SSA form, a MachineInstr can have pairs of tied defs and uses.
The tied operands are used to represent read-modify-write operands that
must be assigned the same physical register.

Previously, tied operand pairs were computed from fixed MCInstrDesc
fields, or by using black magic on inline assembly instructions.

The isTied flag makes it possible to add tied operands to any
instruction while getting rid of (some of) the inlineasm magic.

Tied operands on normal instructions are needed to represent predicated
individual instructions in SSA form. An extra <tied,imp-use> operand is
required to represent the output value when the instruction predicate is
false.

Adding a predicate to:

  %vreg0<def> = ADD %vreg1, %vreg2

Will look like:

  %vreg0<tied,def> = ADD %vreg1, %vreg2, pred:3, %vreg7<tied,imp-use>

The virtual register %vreg7 is the value given to %vreg0 when the
predicate is false. It will be assigned the same physreg as %vreg0.

This commit adds the isTied flag and sets it based on MCInstrDesc when
building an instruction. The flag is not used for anything yet.

llvm-svn: 162774
2012-08-28 18:34:41 +00:00
Chad Rosier f70b7e284c [ms-inline asm] Use dyn_cast<> here to simplify logic.
llvm-svn: 162773
2012-08-28 18:21:14 +00:00
Jordan Rose 595c131460 [analyzer] Don't purge dead symbols at the end of calls if -analyzer-purge=none.
No test case since this is a debug option that we will never turn on by
default since it makes the leak checkers much less useful. (We'll only report
leaks at the end of analysis if -analyzer-purge=none.)

llvm-svn: 162772
2012-08-28 18:16:45 +00:00
Benjamin Kramer 320f188859 Make test pass in Release builds, which use a different naming scheme for llvm values.
llvm-svn: 162771
2012-08-28 18:11:31 +00:00
Jakob Stoklund Olesen dba99d0dfa Don't allow TargetFlags on MO_Register MachineOperands.
Register operands are manipulated by a lot of target-independent code,
and it is not always possible to preserve target flags. That means it is
not safe to use target flags on register operands.

None of the targets in the tree are using register operand target flags.
External targets should be using immediate operands to annotate
instructions with operand modifiers.

llvm-svn: 162770
2012-08-28 18:05:48 +00:00
Michael Liao bf48b1b8e4 Merge test case for PR13704 into exprs.c to reduce test cases
llvm-svn: 162769
2012-08-28 17:46:11 +00:00
Chad Rosier bbbe9ab876 [ms-inline asm] Make the AsmStmt class non-virtual.
llvm-svn: 162768
2012-08-28 17:43:23 +00:00
Bill Wendling 783e7c02c6 Patch by Sean Silva to un-barf his computer by explicitly removing the '\n'
character instead of always the last character.

llvm-svn: 162767
2012-08-28 17:18:27 +00:00
Michael Liao 48f498fccf Fix PR13704
- The increment needs to be signed value to preserve the original value when
  its data type is larger than 64-bit integer.

llvm-svn: 162766
2012-08-28 16:55:13 +00:00
Ted Kremenek 2a226a61da Fix passing of -analyzer-max-loop from scan-build to clang.
llvm-svn: 162765
2012-08-28 16:48:48 +00:00
Hal Finkel 742b535e40 Add PPC Freescale e500mc and e5500 subtargets.
Add subtargets for Freescale e500mc (32-bit) and e5500 (64-bit) to
the PowerPC backend.

Patch by Tobias von Koch.

llvm-svn: 162764
2012-08-28 16:12:39 +00:00
Hans Wennborg f4ad232921 Warn about suspicious implicit conversions from floating point to bool
This warns in two specific situations:

1) For potentially swapped function arguments, e.g.

     void foo(bool, float);
     foo(1.7, false);

2) Misplaced brackets around function call arguments, e.g.

     bool InRange = fabs(a - b < delta);

   Where the last argument in a function call is implicitly converted
   from bool to float, and the function returns a float which gets
   implicitly converted to bool.

Patch by Andreas Eckleder!

llvm-svn: 162763
2012-08-28 15:44:30 +00:00
Kostya Serebryany 66a37f3aef [asan] one more fix for windows build
llvm-svn: 162762
2012-08-28 15:25:07 +00:00
Roman Divacky afe2f23a3c Cleanup FreeBSD linking and add support for -pie.
Path by Brooks Davis, tests and fixes from me.

llvm-svn: 162761
2012-08-28 15:09:03 +00:00
Kostya Serebryany 3a6af66a0e [asan] fix the cmake build (hopefully)
llvm-svn: 162760
2012-08-28 14:48:28 +00:00
Kostya Serebryany 327d0a5666 [asan] actually doing 'svn add' helps
llvm-svn: 162759
2012-08-28 14:27:06 +00:00
Kostya Serebryany 27dcb2379f [asan] fix Windows build
llvm-svn: 162758
2012-08-28 14:14:30 +00:00
Kostya Serebryany 7575968aa4 [asan] actually move StackTrace to sanitizer_common
llvm-svn: 162757
2012-08-28 14:11:57 +00:00
Filipe Cabecinhas c44306f7f3 Fixes by Daniel Malea.
llvm-svn: 162756
2012-08-28 13:59:38 +00:00
Benjamin Kramer 1e1a1dedc6 InstCombine: Defensively avoid undefined shifts by limiting the amount to the bit width.
No test case, undefined shifts get folded early, but can occur when other
transforms generate a constant. Thanks to Duncan for bringing this up.

llvm-svn: 162755
2012-08-28 13:59:23 +00:00
Kostya Serebryany a57b4e823a [asan] even more refactoring to move StackTrace to sanitizer_common
llvm-svn: 162754
2012-08-28 13:49:49 +00:00
Filipe Cabecinhas 46f127ac9e Simplify the typecheck code.
llvm-svn: 162753
2012-08-28 13:49:02 +00:00
Kostya Serebryany ee92877f17 [asan] more refactoring to move StackTrace to sanitizer_common
llvm-svn: 162752
2012-08-28 13:25:55 +00:00
Benjamin Kramer 9c0a807c27 InstCombine: Guard the transform introduced in r162743 against large ints and non-const shifts.
llvm-svn: 162751
2012-08-28 13:08:13 +00:00
Alexey Samsonov 50e8a6a7df [ASan] CMake build: share more compile flags between instrumented and non-instrumented tests
llvm-svn: 162750
2012-08-28 12:38:17 +00:00
Nadav Rotem d457787fed Make sure that we don't call getZExtValue on values > 64 bits.
Thanks Benjamin for noticing this.

llvm-svn: 162749
2012-08-28 12:23:22 +00:00
Kostya Serebryany ccc470c499 [asan] some renaming before we move StackTrace into sanitizer_common (part 2)
llvm-svn: 162748
2012-08-28 11:54:51 +00:00
Kostya Serebryany 6b0d775229 [asan] some renaming before we move StackTrace into sanitizer_common
llvm-svn: 162747
2012-08-28 11:54:30 +00:00
Kostya Serebryany bb6f165952 [asan] get rid of AsanPrintf in favor of Printf from sanitizer_common
llvm-svn: 162746
2012-08-28 11:34:40 +00:00
Kostya Serebryany 4bfe954d14 [asan] improve SetErrorReportCallbackTest to actually catch missing functionality in __asan_set_error_report_callback
llvm-svn: 162745
2012-08-28 11:21:01 +00:00
Simon Atanasyan a80313acbc Check for MIPS target availability for Driver/mips-as.c test.
llvm-svn: 162744
2012-08-28 11:17:20 +00:00
Nadav Rotem 11935b29f3 Teach InstCombine to canonicalize [SU]div+[AL]shl patterns.
For example:
  %1 = lshr i32 %x, 2
  %2 = udiv i32 %1, 100

rdar://12182093

llvm-svn: 162743
2012-08-28 10:01:43 +00:00
Alexey Samsonov 384de7c9c9 [Sanitizer] Allow to create stub MemoryMappingLayout on Windows
llvm-svn: 162742
2012-08-28 08:27:08 +00:00
Bill Wendling cc56718038 The commutative flag is already correctly set within the multiclass. If we set
it here, then a 'register-memory' version would wrongly get the commutative
flag.
<rdar://problem/12180135>

llvm-svn: 162741
2012-08-28 07:36:46 +00:00