Meador Inge
f963a8ffcc
Delete a stale comment. No functional change.
...
llvm-svn: 167698
2012-11-12 00:28:15 +00:00
Craig Topper
dd13d3fda1
Move some helper methods to being static functions in the implementation file.
...
llvm-svn: 167696
2012-11-11 22:45:02 +00:00
Meador Inge
9493eb9bc4
Remove hard-coded constant in Transforms/InstCombine/memcmp-1.ll
...
Transforms/InstCombine/memcmp-1.ll has a test case that looks like:
@foo = constant [4 x i8] c"foo\00"
@hel = constant [4 x i8] c"hel\00"
...
%mem1 = getelementptr [4 x i8]* @hel, i32 0, i32 0
%mem2 = getelementptr [4 x i8]* @foo, i32 0, i32 0
%ret = call i32 @memcmp(i8* %mem1, i8* %mem2, i32 3)
ret i32 %ret
; CHECK: ret i32 2
The folded return value (2 above) is computed using the system memcmp
that the compiler is linked with. This can return different values on
different systems. The test was originally written on an OS X 10.7.5
x86-64 box and passed. However, it failed on one of the x86-64 FreeBSD
buildbots because the system memcpy on that machine returned a different
value (1 instead of 2).
I fixed the test by checking the folding constants with regexes.
llvm-svn: 167691
2012-11-11 07:10:25 +00:00
Meador Inge
d4825780ed
instcombine: Migrate memset optimizations
...
This patch migrates the memset optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.
llvm-svn: 167689
2012-11-11 06:49:03 +00:00
Nadav Rotem
913805703d
Update the vectorizer docs.
...
llvm-svn: 167688
2012-11-11 06:47:51 +00:00
Meador Inge
9cf328b526
instcombine: Migrate memmove optimizations
...
This patch migrates the memmove optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.
llvm-svn: 167687
2012-11-11 06:22:40 +00:00
Meador Inge
dd9234a10a
instcombine: Migrate memcpy optimizations
...
This patch migrates the memcpy optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.
llvm-svn: 167686
2012-11-11 05:54:34 +00:00
Nadav Rotem
3b99dc62a7
Use the isTruncFree and isZExtFree API to figure out of these operations are free. Thanks Andy!
...
llvm-svn: 167685
2012-11-11 05:34:45 +00:00
Nadav Rotem
12930749ab
Fix a comment typo and add comments.
...
llvm-svn: 167684
2012-11-11 05:15:00 +00:00
Meador Inge
4d2827c10d
instcombine: Migrate memcmp optimizations
...
This patch migrates the memcmp optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.
llvm-svn: 167683
2012-11-11 05:11:20 +00:00
Meador Inge
56edbc9323
instcombine: Migrate strstr optimizations
...
This patch migrates the strstr optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.
llvm-svn: 167682
2012-11-11 03:51:48 +00:00
Meador Inge
76fc1a479a
Add method for replacing instructions to LibCallSimplifier
...
In some cases the library call simplifier may need to replace instructions
other than the library call being simplified. In those cases it may be
necessary for clients of the simplifier to override how the replacements
are actually done. As such, a new overrideable method for replacing
instructions was added to LibCallSimplifier.
A new subclass of LibCallSimplifier is also defined which overrides
the instruction replacement method. This is because the instruction
combiner defines its own replacement method which updates the worklist
when instructions are replaced.
llvm-svn: 167681
2012-11-11 03:51:43 +00:00
Benjamin Kramer
933f41161d
Provide definitions for all functions.
...
ICC refuses to compile a class in an anonymous namespace if some functions
aren't defined. Fixes PR13477.
llvm-svn: 167676
2012-11-10 16:10:16 +00:00
Meador Inge
bcd88ef764
instcombine: Migrate strcspn optimizations
...
This patch migrates the strcspn optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.
llvm-svn: 167675
2012-11-10 15:16:48 +00:00
Benjamin Kramer
91b014cd66
Simplify the SmallVector pretty printer for LLDB a bit and make it work with reference types.
...
llvm-svn: 167674
2012-11-10 09:45:32 +00:00
Craig Topper
a43e2fd3eb
Remove unnecessary subtraction and addition by 1 around a couple for loops.
...
llvm-svn: 167673
2012-11-10 09:25:36 +00:00
Craig Topper
84afbf2b02
Tidy up spacing. No functional change.
...
llvm-svn: 167671
2012-11-10 09:02:47 +00:00
Craig Topper
2dfc1a4d24
Removed unimplemented method declaration.
...
llvm-svn: 167670
2012-11-10 09:00:12 +00:00
Craig Topper
f5d527401f
Simplify custom emitter code for pcmp(e/i)str(i/m) and make the helper functions static.
...
llvm-svn: 167669
2012-11-10 08:57:41 +00:00
Evan Cheng
a5d363ec24
Convert an improper CodeGen test to a MC test.
...
llvm-svn: 167663
2012-11-10 04:30:40 +00:00
Meador Inge
03be256db9
instcombine: Query target library information to gate libcall simplifications
...
Several of the simplifiers migrated from the simplify-libcalls pass to
the instcombine pass were not correctly checking the target library
information to gate the simplifications. This patch ensures that the
check is made.
llvm-svn: 167660
2012-11-10 03:11:10 +00:00
Meador Inge
2526a42ef1
Add more functions to the target library information.
...
In the process of migrating optimizations from the simplify-libcalls pass
to the instcombine pass I noticed that a few functions are missing from
the target library information. These functions need to be available for
querying in the instcombine library call simplifiers. More functions will
probably be added in the future as more simplifiers are migrated to
instcombine.
llvm-svn: 167659
2012-11-10 03:11:06 +00:00
Evan Cheng
a17fea1967
xfail a bad test. This is a MC test but it's dependent on a codegen optimization which is now disabled.
...
llvm-svn: 167658
2012-11-10 02:34:36 +00:00
Evan Cheng
21b0348199
Disable the Thumb no-return call optimization:
...
mov lr, pc
b.w _foo
The "mov" instruction doesn't set bit zero to one, it's putting incorrect
value in lr. It messes up backtraces.
rdar://12663632
llvm-svn: 167657
2012-11-10 02:09:05 +00:00
Craig Topper
9268c94b15
Cleanup pcmp(e/i)str(m/i) instruction definitions and load folding support.
...
llvm-svn: 167652
2012-11-10 01:23:36 +00:00
Justin Holewinski
2dc9d072e5
[NVPTX] Use ABI alignment for parameters when alignment is not specified.
...
Affects SM 2.0+. Fixes bug 13324.
llvm-svn: 167646
2012-11-09 23:50:24 +00:00
Evandro Menezes
03789a9ec7
Fix issue with invalid flat operand number
...
Avoid iterating over list of operands beyond the number of operands in it.
PS: this fixes issue with revision #167634 .
llvm-svn: 167635
2012-11-09 21:27:03 +00:00
Evandro Menezes
567698a6ca
Fix issue with invalid flat operand number
...
Avoid iterating over list of operands beyond the number of operands in it.
llvm-svn: 167634
2012-11-09 20:29:37 +00:00
Anton Korobeynikov
a305ea5511
Add ARM TARGET2 relocation. The testcase will follow with actualy use-case.
...
Based on the patch by Logan Chien!
llvm-svn: 167633
2012-11-09 20:20:12 +00:00
Roman Divacky
22135678b9
Switch FreeBSD/i386 back to 4byte stack alignment. This partially
...
reverts r126226.
llvm-svn: 167632
2012-11-09 20:10:44 +00:00
Jakob Stoklund Olesen
13d5562963
Fix assertions in updateRegMaskSlots().
...
The RegMaskSlots contains 'r' slots while NewIdx and OldIdx are 'B'
slots. This broke the checks in the assertions.
This fixes PR14302.
llvm-svn: 167625
2012-11-09 19:18:49 +00:00
Chad Rosier
66bb178eef
Revert r167620; this can be implemented using an existing CL option.
...
llvm-svn: 167622
2012-11-09 18:25:27 +00:00
Chad Rosier
332fc75b2c
Add support for -mstrict-align compiler option for ARM targets.
...
rdar://12340498
llvm-svn: 167620
2012-11-09 17:29:38 +00:00
Benjamin Kramer
c280f41864
Silence GCC warning about falling off the end of a non-void function.
...
llvm-svn: 167618
2012-11-09 15:45:22 +00:00
Dmitry Vyukov
0044e386e9
tsan: switch to new memory_order constants (ABI compatible)
...
llvm-svn: 167615
2012-11-09 14:12:16 +00:00
Dmitry Vyukov
92b9e1dbfd
tsan: instrument all atomics (including fetch_add, exchange, cas, etc)
...
llvm-svn: 167612
2012-11-09 12:55:36 +00:00
Nadav Rotem
1cfef3e9ee
Add support for memory runtime check. When we can, we calculate array bounds.
...
If the arrays are found to be disjoint then we run the vectorized version of
the loop. If they are not, we run the scalar code.
llvm-svn: 167608
2012-11-09 07:09:44 +00:00
Nadav Rotem
d1e906e1f1
indent
...
llvm-svn: 167607
2012-11-09 07:02:24 +00:00
NAKAMURA Takumi
43ab4ef9ba
llvm/ConstantFolding.cpp: Make ReadDataFromGlobal() and FoldReinterpretLoadFromConstPtr() Big-endian-aware.
...
llvm-svn: 167595
2012-11-08 20:34:25 +00:00
Benjamin Kramer
08be41adbf
Drop the limitation to IEEE floating point types from the fdiv of pow2 -> fmul transform.
...
This is safe for x87 long doubles and ppc double doubles too.
llvm-svn: 167582
2012-11-08 13:58:10 +00:00
Amara Emerson
ec2cd56708
Recommit modified r167540.
...
Improve ARM build attribute emission for architectures types.
This also changes the default architecture emitted for a generic CPU to "v7".
llvm-svn: 167574
2012-11-08 09:51:45 +00:00
Michael Liao
73cffddb95
Add support of RTM from TSX extension
...
- Add RTM code generation support throught 3 X86 intrinsics:
xbegin()/xend() to start/end a transaction region, and xabort() to abort a
tranaction region
llvm-svn: 167573
2012-11-08 07:28:54 +00:00
Meador Inge
489b5d645f
instcombine: Migrate strspn optimizations
...
This patch migrates the strspn optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.
llvm-svn: 167568
2012-11-08 01:33:50 +00:00
Eric Christopher
e5be9fc1c2
Fix up comment typo and 80-col.
...
llvm-svn: 167560
2012-11-07 23:38:51 +00:00
Eric Christopher
7c678de861
Add a relocation visitor to lib object. This works via caching relocated
...
values in a map that can be passed to consumers. Add a testcase that
ensures this works for llvm-dwarfdump.
llvm-svn: 167558
2012-11-07 23:22:07 +00:00
Hans Wennborg
c3c8d95c51
Only do switch-to-lookup table transformation when TargetTransformInfo
...
is available.
llvm-svn: 167552
2012-11-07 21:35:12 +00:00
Akira Hatanaka
28e02ec8c1
[mips] Custom-lower ISD::FRAME_TO_ARGS_OFFSET node.
...
Patch by Sasa Stankovic.
llvm-svn: 167548
2012-11-07 19:10:58 +00:00
Akira Hatanaka
40f2d30987
Delete MipsFunctionInfo::NextStackOffset. No functionality change intended.
...
llvm-svn: 167546
2012-11-07 19:04:26 +00:00
Amara Emerson
dfa5cafb98
Revert r167540 until regression tests are updated.
...
llvm-svn: 167545
2012-11-07 18:57:14 +00:00
Bill Wendling
3fdaa244e1
Remove accidental commit.
...
llvm-svn: 167544
2012-11-07 18:39:32 +00:00