Eli Friedman [Wed, 25 May 2011 19:09:45 +0000 (19:09 +0000)]
Prepare ARMFastISel::SelectSIToFP for getRegForValue returning registers for i8 and i16 values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132073
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 25 May 2011 18:17:13 +0000 (18:17 +0000)]
Simplify r132022 based on Cameron's feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132071
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 25 May 2011 18:08:32 +0000 (18:08 +0000)]
Update MaxCallFrameSize regardless of the relocation model selected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132070
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 25 May 2011 17:52:48 +0000 (17:52 +0000)]
Change initial value of MaxCallFrameSize. MipsFI::getMaxCallFrameSize() should
return 0 if there are no function calls made.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132065
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 25 May 2011 17:32:06 +0000 (17:32 +0000)]
Coding style fixes. Added comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132063
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Wed, 25 May 2011 17:02:53 +0000 (17:02 +0000)]
Remove unused OpcodeMask enumerator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132062
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Wed, 25 May 2011 16:32:33 +0000 (16:32 +0000)]
Fix 3 MSVC warnings:
'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)'
atexit really expects a "void f(void)" function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132061
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Wed, 25 May 2011 15:58:10 +0000 (15:58 +0000)]
Fix MSVC warning: "is out of range for enum constant"
MSVC doesn't support 64 bit enum.
OpcodeMask is not used anywhere in the code base.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132057
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 25 May 2011 12:54:08 +0000 (12:54 +0000)]
Fix some issues Duncan found in the previous commit.
I kept the reference to the ABI since that is the common case. The
-fno-asynchronous-unwind-tables option is a user controlled way of breaking
the ABI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132053
91177308-0d34-0410-b5e6-
96231b3b80d8
Frits van Bommel [Wed, 25 May 2011 06:32:23 +0000 (06:32 +0000)]
Fix warning in the CMake build about redefining LLVM_PATH_XDOT_PY by making sure both definitions are identical. This used to produce warnings like
In file included from .../llvm/trunk/tools/lto/LTOCodeGenerator.cpp:45:
In file included from .../llvm/trunk/include/llvm/Support/system_error.h:225:
.../include/llvm/Config/config.h:591:9: warning: 'LLVM_PATH_XDOT_PY' macro redefined
#define LLVM_PATH_XDOT_PY ".../bin/xdot.py"
^
.../include/llvm/Config/llvm-config.h:98:9: note: previous definition is here
#define LLVM_PATH_XDOT_PY ""
^
1 warning generated.
(Paths edited for clarity)
Note: This only affected people who had xdot.py installed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132050
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 25 May 2011 05:04:22 +0000 (05:04 +0000)]
[tablegen] A couple of changes to ClangDiagnosticEmmitter.
-Emit an empty warning option as string ("") instead of 0.
-For diagnostic names also emit the size of the string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132046
91177308-0d34-0410-b5e6-
96231b3b80d8
Charles Davis [Wed, 25 May 2011 04:51:25 +0000 (04:51 +0000)]
Add tests for .seh_savereg and .seh_savexmm parsing. Once again, fix the
buggy methods that parse these directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132045
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 25 May 2011 04:48:17 +0000 (04:48 +0000)]
Restore an accidentally removed comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132044
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 25 May 2011 04:45:29 +0000 (04:45 +0000)]
Move some code to a more logical place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132043
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 25 May 2011 04:45:27 +0000 (04:45 +0000)]
Make tTAILJMPr/tTAILJMPrND emit a tBX without a preceding MOV of PC to LR. This
fixes <rdar://problem/
9495913>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132042
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 25 May 2011 04:45:23 +0000 (04:45 +0000)]
Change the order of tBX's operands so that the predicate operands come after the
target register, matching BX. I filed this bug because I was confused at first:
PR10007 - ARM branch instructions have inconsistent predicate operand placement
<http://llvm.org/bugs/show_bug.cgi?id=10007>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132041
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 25 May 2011 04:45:20 +0000 (04:45 +0000)]
Rename tBX_Rm to tBX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132040
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Wed, 25 May 2011 04:45:14 +0000 (04:45 +0000)]
Rename the existing tBX/tBXr9 instructions to tBX_CALL/tBXr9_CALL to better
reflect their actual meaning and match the ARM instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132039
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 25 May 2011 04:42:22 +0000 (04:42 +0000)]
indvars: fixed IV cloning in -disable-iv-rewrite mode with associated
cleanup and overdue test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132038
91177308-0d34-0410-b5e6-
96231b3b80d8
Charles Davis [Wed, 25 May 2011 04:08:15 +0000 (04:08 +0000)]
Add a test for .seh_pushframe parsing. Fix the bug exposed by it (and another
one I found by inspection).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132037
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 25 May 2011 03:44:17 +0000 (03:44 +0000)]
Replace the -unwind-tables option with a per function flag. This is more
LTO friendly as we can now correctly merge files compiled with or without
-fasynchronous-unwind-tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132033
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 25 May 2011 02:20:00 +0000 (02:20 +0000)]
Fix lowering of DYNAMIC_STACKALLOC nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132030
91177308-0d34-0410-b5e6-
96231b3b80d8
Charles Davis [Wed, 25 May 2011 01:33:42 +0000 (01:33 +0000)]
Add a test for the .seh_handler directive. Fix problems with the parsing
method exposed by the test. While we're at it, simplify the .seh_proc
parsing method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132028
91177308-0d34-0410-b5e6-
96231b3b80d8
Bruno Cardoso Lopes [Wed, 25 May 2011 00:35:03 +0000 (00:35 +0000)]
Fix PR9762
Enable the parsing of the operand "cpsr_all" for the ARM msr instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132026
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 24 May 2011 23:47:50 +0000 (23:47 +0000)]
Forgot dyn_cast check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132025
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 24 May 2011 23:27:13 +0000 (23:27 +0000)]
Implement the arm 'L' asm modifier.
Part of rdar://
9119939
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132024
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 24 May 2011 23:15:43 +0000 (23:15 +0000)]
Implement the immediate part of the 'B' modifier.
Part of rdar://
9119939
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132023
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 24 May 2011 23:12:57 +0000 (23:12 +0000)]
Fix LoopUnswitch bug. RewriteLoopBodyWithConditionConstant can delete a dead
case of a switch instruction. Back off this optimization when this would
eliminate all of the predecessors to the latch.
Sorry, I am unable to reduce a reasonably sized test case.
rdar://
9486843
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132022
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 24 May 2011 22:27:43 +0000 (22:27 +0000)]
Add more unimplemented asm modifiers and some documentation of what they
do.
Part of rdar://
9119939.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132015
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 24 May 2011 22:10:34 +0000 (22:10 +0000)]
Add support for the arm 'y' asm modifier.
Fixes part of rdar://
9444657
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132011
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 24 May 2011 22:01:32 +0000 (22:01 +0000)]
Update documentation: -basicaa does chaining these days.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132010
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 24 May 2011 21:28:18 +0000 (21:28 +0000)]
Test case for r132003.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132005
91177308-0d34-0410-b5e6-
96231b3b80d8
Charles Davis [Tue, 24 May 2011 21:22:53 +0000 (21:22 +0000)]
Test basic SEH directive-parsing functionality. Fix a latent bug exposed by
this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132004
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 24 May 2011 21:22:21 +0000 (21:22 +0000)]
Enable printing of immediates that do not fit in 16-bit. .cprestore can have
offsets that are larger than 0x10000.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132003
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Tue, 24 May 2011 20:22:24 +0000 (20:22 +0000)]
Change condition for determining whether a function is small for inlining metrics so that very long functions
with few basic blocks are not re-analyzed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131994
91177308-0d34-0410-b5e6-
96231b3b80d8
Charles Davis [Tue, 24 May 2011 20:06:30 +0000 (20:06 +0000)]
Implement the rest of the SEH directive-parsing methods in the COFFAsmParser.
Add a size alignment check to the .seh_stackalloc directive parser. Add a
more descriptive error message to the .seh_handler directive parser.
Add methods to the TargetAsmInfo struct in support of all this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131992
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 24 May 2011 19:37:15 +0000 (19:37 +0000)]
Fix test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131988
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 24 May 2011 19:29:37 +0000 (19:29 +0000)]
Revision 131986 test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131987
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 24 May 2011 19:18:33 +0000 (19:18 +0000)]
Implement byval structure argument passing. The following limitations or
deficiencies exist:
- Works only if ABI is o32.
- Zero-sized structures cannot be passed.
- There is a lot of redundancy in generated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131986
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Tue, 24 May 2011 18:52:07 +0000 (18:52 +0000)]
Make instcombine O(N) instead of O(N^2) in code where the same simplifiable constant is used many times.
Part of rdar://
9471075.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131979
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 24 May 2011 18:27:52 +0000 (18:27 +0000)]
Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131974
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Tue, 24 May 2011 18:26:09 +0000 (18:26 +0000)]
Fix "make check" in Release by removing debug-only options from an 'opt' invocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131972
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 24 May 2011 18:24:08 +0000 (18:24 +0000)]
Make DecomposeGEPExpression check SimplifyInstruction only
after checking for a GEP, so that it matches what GetUnderlyingObject
does. This fixes an obscure bug turned up by bugpoint in the testcase
for PR9931.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131971
91177308-0d34-0410-b5e6-
96231b3b80d8
Charles Davis [Tue, 24 May 2011 16:57:53 +0000 (16:57 +0000)]
Add a method to TargetRegisterInfo to get the register number that the Win64 EH
scheme uses internally. Implement it for x86 (the only architecture that LLVM
supports for which this matters right now).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131969
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Tue, 24 May 2011 06:00:08 +0000 (06:00 +0000)]
Clean up the lazy initialization of DIBuilder a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131956
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 24 May 2011 03:20:56 +0000 (03:20 +0000)]
Work around code generation bug in Visual Studio 2010.
See http://llvm.org/pr9976 for details.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131954
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Tue, 24 May 2011 03:10:43 +0000 (03:10 +0000)]
Make LoadAndStorePromoter preserve debug info and create llvm.dbg.values when
promoting allocas to SSA variables. Fixes <rdar://problem/
9479036>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131953
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 24 May 2011 03:10:31 +0000 (03:10 +0000)]
Explain FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131952
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 24 May 2011 02:50:20 +0000 (02:50 +0000)]
Fix the defaults for .eh_frame. We were marking it as writable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131951
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 24 May 2011 01:48:22 +0000 (01:48 +0000)]
- Teach SelectionDAG::isKnownNeverZero to return true (op x, c) when c is
non-zero.
- Teach X86 cmov optimization to eliminate the cmov from ctlz, cttz extension
when the source of X86ISD::BSR / X86ISD::BSF is proven to be non-zero.
rdar://
9490949
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131948
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 24 May 2011 01:43:38 +0000 (01:43 +0000)]
Remove dead option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131947
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 24 May 2011 01:02:49 +0000 (01:02 +0000)]
FileCheck-ize a couple of IV unit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131946
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 24 May 2011 00:58:06 +0000 (00:58 +0000)]
Fix cmake dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131943
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 24 May 2011 00:23:52 +0000 (00:23 +0000)]
Simplify offset calculation of stack frame objects for $gp restore location and
variable arguments in LowerCall and LowerFormalArguments. This should also fix
the bug in which handling of variable arguments is incorrect when the front-end
optimizes away unused fixed arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131942
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 24 May 2011 00:22:25 +0000 (00:22 +0000)]
Fix debug info for blocks' variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131940
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 24 May 2011 00:17:53 +0000 (00:17 +0000)]
Test case for r130799 - indvars: Added canExpandBackEdgeTakenCount.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131939
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Mon, 23 May 2011 23:16:14 +0000 (23:16 +0000)]
Remove unnecessary comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131936
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Mon, 23 May 2011 22:23:58 +0000 (22:23 +0000)]
Expand f64 FPOW.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131928
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Mon, 23 May 2011 22:16:43 +0000 (22:16 +0000)]
Add pattern for double-to-integer conversion. Patch by Sasa Stankovic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131927
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Mon, 23 May 2011 22:04:42 +0000 (22:04 +0000)]
Revert 121907 (it causes llc crash) and apply original patch from PR9817.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131926
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Mon, 23 May 2011 21:13:59 +0000 (21:13 +0000)]
Fixes related to coding style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131922
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 23 May 2011 21:13:03 +0000 (21:13 +0000)]
Document llvm.exp and llvm.pow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131921
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 23 May 2011 21:07:39 +0000 (21:07 +0000)]
When checking for signed multiplication overflow, watch out for INT_MIN and -1.
This fixes PR9845.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131919
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Mon, 23 May 2011 20:36:04 +0000 (20:36 +0000)]
Propagate error correctly in the MC Asm parser for leading '$' expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131918
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Mon, 23 May 2011 20:34:30 +0000 (20:34 +0000)]
Fix MipsAsmPrinter::printSavedRegsBitmaskChange. Remove functions and variables
in MipsFunctionInfo that are no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131917
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 23 May 2011 20:17:44 +0000 (20:17 +0000)]
clarify this, apparently it is confusing :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131916
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Mon, 23 May 2011 20:16:59 +0000 (20:16 +0000)]
Change StackDirection from StackGrowsUp to StackGrowsDown.
The following improvements are accomplished as a result of applying this patch:
- Fixed frame objects' offsets (relative to either the virtual frame pointer or
the stack pointer) are set before instruction selection is completed. There is
no need to wait until Prologue/Epilogue Insertion is run to set them.
- Calculation of final offsets of fixed frame objects is straightforward. It is
no longer necessary to assign negative offsets to fixed objects for incoming
arguments in order to distinguish them from the others.
- Since a fixed object has its relative offset set during instruction
selection, there is no need to conservatively set its alignment to 4.
- It is no longer necessary to reorder non-fixed frame objects in
MipsFrameLowering::adjustMipsStackFrame.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131915
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Mon, 23 May 2011 17:49:29 +0000 (17:49 +0000)]
Test case for r131908.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131909
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Mon, 23 May 2011 17:44:13 +0000 (17:44 +0000)]
Preserve debug info during iSel by keeping DanglingDebugInfoMap live until end of function.
Patch by Micah Villmow
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131908
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Mon, 23 May 2011 17:35:08 +0000 (17:35 +0000)]
While replacing all uses of a SDValue with another value, do not forget to transfer SDDbgValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131907
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Mon, 23 May 2011 17:34:18 +0000 (17:34 +0000)]
Clear list of instructions without DebugLoc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131906
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Mon, 23 May 2011 16:50:29 +0000 (16:50 +0000)]
The dragonegg option to disable LLVM optimizations changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131903
91177308-0d34-0410-b5e6-
96231b3b80d8
Charles Davis [Mon, 23 May 2011 16:43:09 +0000 (16:43 +0000)]
Implement .seh_stackalloc and .seh_pushframe parsing.
I haven't implemented any of the ones that take registers yet. The problem is
that for x86-64 the streamer methods expect a native x86 register number (note:
%r8-%r15 want 8-15 instead of 0-7; same for %xmm8-%xmm15). I haven't figured
out exactly how I want to do that yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131899
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 23 May 2011 05:15:43 +0000 (05:15 +0000)]
fix a really nasty basicaa mod/ref calculation bug that was causing miscompilation of
UnitTests/ObjC/messages-2.m with the recent optimizer improvements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131897
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Zwarich [Mon, 23 May 2011 01:57:17 +0000 (01:57 +0000)]
Fix <rdar://problem/
9476260> by having tail calls always generate 32-bit branches
in Darwin Thumb2 code. Tail calls are already disabled on Thumb1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131894
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 23 May 2011 00:32:19 +0000 (00:32 +0000)]
rearrange two transforms, since one subsumes the other. Make the shift-exactness
xform recurse.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131888
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 23 May 2011 00:21:50 +0000 (00:21 +0000)]
Transform any logical shift of a power of two into an exact/NUW shift when
in a known-non-zero context.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131887
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 23 May 2011 00:18:33 +0000 (00:18 +0000)]
Use a more efficient data structure for the "operand map". The number of
operands to an instruction aren't great, so an iterative search is fairly quick
and doesn't have the overhead of std::map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131886
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 23 May 2011 00:09:55 +0000 (00:09 +0000)]
use the valuetracking isPowerOfTwo function, which is more powerful than checking
for a constant directly. Thanks to Duncan for pointing this out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131885
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 23 May 2011 00:03:39 +0000 (00:03 +0000)]
Teach valuetracking that byval arguments with a specified alignment are
aligned.
Teach memcpyopt to not give up all hope when confonted with an underaligned
memcpy feeding an overaligned byval. If the *source* of the memcpy can be
determined to be adequeately aligned, or if it can be forced to be, we can
eliminate the memcpy.
This addresses PR9794. We now compile the example into:
define i32 @f(%struct.p* nocapture byval align 8 %q) nounwind ssp {
entry:
%call = call i32 @g(%struct.p* byval align 8 %q) nounwind
ret i32 %call
}
in both x86-64 and x86-32 mode. We still don't get a tailcall though,
because tailcalls apparently can't handle byval.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131884
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 23:57:23 +0000 (23:57 +0000)]
add a helper method to get the byval alignment of an argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131883
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 23:23:02 +0000 (23:23 +0000)]
Eliminate some temporary variables, and don't call getByValTypeAlignment
when we're just going to throw the result away. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131880
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 22:35:34 +0000 (22:35 +0000)]
add test from PR9164
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131876
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 22:32:53 +0000 (22:32 +0000)]
testcase for PR9378
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131875
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 22:31:57 +0000 (22:31 +0000)]
add a missing alias to make us more bug compatible with gcc, PR9378
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131874
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 22:28:47 +0000 (22:28 +0000)]
document thiscall, PR9101
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131873
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 22:22:35 +0000 (22:22 +0000)]
implement PR9315, constant folding exp2 in terms of pow (since hosts without
C99 runtimes don't have exp2).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131872
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Sun, 22 May 2011 21:41:23 +0000 (21:41 +0000)]
RTABI chapter 4.3.4 specifies __eabi_mem* calls. Specifically, __eabi_memset accepts parameters (ptr, size, value) in a different order than GNU's memset (ptr, value, size), therefore the special lowering in AAPCS mode. Implementation by Evzen Muller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131868
91177308-0d34-0410-b5e6-
96231b3b80d8
Charles Davis [Sun, 22 May 2011 21:12:15 +0000 (21:12 +0000)]
Add methods to parse the SEH directives to the COFFAsmParser. Implement some
of them, particularly the ones that don't take arguments. Also implement
.seh_proc and .seh_handler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131866
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 18:28:46 +0000 (18:28 +0000)]
add a note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131863
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 18:26:48 +0000 (18:26 +0000)]
add some random notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131862
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sun, 22 May 2011 18:25:30 +0000 (18:25 +0000)]
Teach ValueTracking about x86 crc32 intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131861
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 18:18:41 +0000 (18:18 +0000)]
Carve out a place in instcombine to put transformations which work knowing that their
result is non-zero. Implement an example optimization (PR9814), which allows us to
transform:
A / ((1 << B) >>u 2)
into:
A >>u (B-2)
which we compile into:
_divu3: ## @divu3
leal -2(%rsi), %ecx
shrl %cl, %edi
movl %edi, %eax
ret
instead of:
_divu3: ## @divu3
movb %sil, %cl
movl $1, %esi
shll %cl, %esi
shrl $2, %esi
movl %edi, %eax
xorl %edx, %edx
divl %esi, %eax
ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131860
91177308-0d34-0410-b5e6-
96231b3b80d8
Johnny Chen [Sun, 22 May 2011 17:51:04 +0000 (17:51 +0000)]
Fix Bug 9386 - ARM disassembler failed to disassemble conditional bx
Modified the patch to .td file supplied by Jyun-Yan You. Add a test case and
modified ARMDisassemblerCore.cpp a little bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131859
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 17:39:56 +0000 (17:39 +0000)]
Fix PR9815: I was trying to get out of "generating code and then
failing to form a memset, then having to delete it" but my approximation
isn't safe for self recurrent loops. Instead of doign a hack, just
do it the right way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131858
91177308-0d34-0410-b5e6-
96231b3b80d8
Frits van Bommel [Sun, 22 May 2011 16:24:18 +0000 (16:24 +0000)]
Add a parameter to ConstantFoldTerminator() that callers can use to ask it to also clean up the condition of any conditional terminator it folds to be unconditional, if that turns the condition into dead code. This just means it calls RecursivelyDeleteTriviallyDeadInstructions() in strategic spots. It defaults to the old behavior.
I also changed -simplifycfg, -jump-threading and -codegenprepare to use this to produce slightly better code without any extra cleanup passes (AFAICT this was the only place in -simplifycfg where now-dead conditions of replaced terminators weren't being cleaned up). The only other user of this function is -sccp, but I didn't read that thoroughly enough to figure out whether it might be holding pointers to instructions that could be deleted by this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131855
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 15:44:02 +0000 (15:44 +0000)]
another typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131854
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 15:34:37 +0000 (15:34 +0000)]
fix comment typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131853
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 07:20:02 +0000 (07:20 +0000)]
I missed a checking with my GVN change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131851
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 22 May 2011 07:18:08 +0000 (07:18 +0000)]
insertvalue takes a variable number of arguments, document this, fixing PR9935.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131850
91177308-0d34-0410-b5e6-
96231b3b80d8