Duncan Sands
5ab54d488f
Introduce new linkage types linkonce_odr, weak_odr, common_odr
...
and extern_weak_odr. These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global. In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time. This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function. If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body. The
code generators on the other hand map weak and weak_odr linkage
to the same thing.
llvm-svn: 66339
2009-03-07 15:45:40 +00:00
Dale Johannesen
0643e4e36c
Fix another case where debug info interferes with
...
an optimization.
llvm-svn: 66288
2009-03-06 21:08:33 +00:00
Devang Patel
3ae9d5d375
While hoisting instruction to speculatively execute simple bb, ignore dbg intrinsics.
...
llvm-svn: 66255
2009-03-06 06:00:17 +00:00
Dale Johannesen
83c13c2ace
Tweak the check for promotable alloca's to handle
...
debug intrinsics correctly.
llvm-svn: 66225
2009-03-06 00:42:50 +00:00
Devang Patel
28a28a2588
Add "check/remove dbg var" helper routines.
...
llvm-svn: 66223
2009-03-06 00:19:37 +00:00
Dale Johannesen
8ca4d24371
Revert unintended commmit.
...
llvm-svn: 66001
2009-03-04 02:09:48 +00:00
Dale Johannesen
c6bfdb8253
Skip ptr-to-ptr bitcasts when counting in another case.
...
llvm-svn: 66000
2009-03-04 02:06:53 +00:00
Dale Johannesen
e184480072
Always skip ptr-to-ptr bitcasts when counting,
...
per Chris' suggestion. Slightly faster.
llvm-svn: 65999
2009-03-04 01:53:05 +00:00
Dale Johannesen
e611f70764
Marking debug info intrinsics as not touching memory
...
caused them to be considered trivially dead. Fix this.
llvm-svn: 65979
2009-03-03 23:30:00 +00:00
Dale Johannesen
81b6cd8ce5
Instruction counters must skip the bitcasts that
...
feed into llvm.dbg.declare nodes, as well as
the debug directives themselves.
llvm-svn: 65976
2009-03-03 22:36:47 +00:00
Dale Johannesen
ceed180d4c
When removing a store to an alloca that has only one
...
use, check also for the case where it has two uses,
the other being a llvm.dbg.declare. This is needed so
debug info doesn't affect codegen.
llvm-svn: 65970
2009-03-03 21:26:39 +00:00
Bill Wendling
7fdda71ad7
Remove accidental check-ins in r65960. :-(
...
llvm-svn: 65961
2009-03-03 19:25:16 +00:00
Bill Wendling
8244b700bf
Use > instead of >=. We want to promote aggregates of 128-bytes.
...
llvm-svn: 65960
2009-03-03 19:18:49 +00:00
Dan Gohman
51d4e8db6a
Fix a bunch of Doxygen syntax issues. Escape special characters,
...
and put @file directives on their own comment line.
llvm-svn: 65920
2009-03-03 02:55:14 +00:00
Dale Johannesen
33fa9dc8a9
When sinking an insn in InstCombine bring its debug
...
info with it.
Don't count debug info insns against the scan maximum
in FindAvailableLoadedValue (lest they affect codegen).
llvm-svn: 65910
2009-03-03 01:09:07 +00:00
Nick Lewycky
f5563f28d3
Fix compiler warning about uninitialized variables. No functional change.
...
llvm-svn: 65620
2009-02-27 06:29:31 +00:00
Zhou Sheng
670d50e102
Ignore dbg info intrinsics when folding conditional branch to
...
conditional branch predecessors.
llvm-svn: 65509
2009-02-26 06:56:37 +00:00
Zhou Sheng
241d74737b
Don't block basic block with only SwitchInst to fold into predecessors.
...
llvm-svn: 65456
2009-02-25 15:34:27 +00:00
Devang Patel
702836b2dd
While folding unconditional return move DbgRegionEndInst into the predecessor, instead of removing it. This fixes following tests from llvmgcc42 testsuite.
...
gcc.c-torture/execute/20000605-3.c
gcc.c-torture/execute/20020619-1.c
gcc.c-torture/execute/20030920-1.c
gcc.c-torture/execute/loop-ivopts-1.c
llvm-svn: 65353
2009-02-24 00:05:16 +00:00
Mon P Wang
75d957dba4
Changed option name from inline-threshold to basic-inline-threshold because
...
inline-threshold option is used by the inliner.
llvm-svn: 65309
2009-02-23 07:07:56 +00:00
Evan Cheng
74d0dda00f
Add AddrModeMatcher.cpp
...
llvm-svn: 65228
2009-02-21 07:05:11 +00:00
Evan Cheng
d8aad94754
Factor address mode matcher out of codegen prepare to make it available to other passes, e.g. loop strength reduction.
...
llvm-svn: 65134
2009-02-20 18:24:38 +00:00
Zhou Sheng
0c2e862ad0
Just roll back the previous change to -mem2reg.
...
Will re-think about this according to Chris's comments.
llvm-svn: 65126
2009-02-20 17:49:33 +00:00
Zhou Sheng
580c176f47
patch to update the line number information in pass -mem2reg.
...
Currently this pass will delete the variable declaration info,
and keep the line number info. But the kept line number info is not updated,
and some is redundant or not correct, this patch just updates those info.
llvm-svn: 65123
2009-02-20 16:31:35 +00:00
Nick Lewycky
6feb7523b8
Fix typo caused by too much surfing, dudes...
...
llvm-svn: 64626
2009-02-16 04:26:53 +00:00
Chris Lattner
5babade39e
Fix a nasty bug (PR3550) where the inline pass could incorrectly mark
...
calls with the tail marker when inlining them through an invoke. Patch,
testcase, and perfect analysis by Jay Foad!
llvm-svn: 64364
2009-02-12 07:06:42 +00:00
Devang Patel
dd611eac76
If llvm.dbg.region.end is disappearing then remove corresponding llvm.dbg.func.start also.
...
llvm-svn: 64278
2009-02-11 01:29:06 +00:00
Devang Patel
60571be0de
Ignore dbg intrinsic while folding unconditional branch.
...
llvm-svn: 64242
2009-02-10 22:14:17 +00:00
Devang Patel
6c041de2ff
Do not clone llvm.dbg.func.start and corresponding llvm.dbg.region.end during inlining.
...
llvm-svn: 64209
2009-02-10 07:48:18 +00:00
Devang Patel
7377e7aa89
Enable scalar replacement of AllocaInst whose one of the user is dbg info.
...
llvm-svn: 64207
2009-02-10 07:00:59 +00:00
Devang Patel
72f5fba371
Revert rev. 63876. It is causing llvm-gcc bootstrap failure.
...
llvm-svn: 63888
2009-02-05 21:46:41 +00:00
Devang Patel
66eee02024
Ignore dbg intrinsics while propagating conditional expression info.
...
llvm-svn: 63876
2009-02-05 19:15:39 +00:00
Devang Patel
e665f78460
Ignore dbg intrinsics while folding switch instruction.
...
llvm-svn: 63802
2009-02-05 00:30:42 +00:00
Devang Patel
10be164b28
Ignore dbg intrinsics.
...
llvm-svn: 63781
2009-02-04 21:39:48 +00:00
Devang Patel
2fac28a8c7
While folding vallue comparison terminators ignore dbg intrinsics.
...
llvm-svn: 63700
2009-02-04 01:06:11 +00:00
Devang Patel
bc5a1a7007
Ignore dbg intrinsics while hoisting common code in the two blocks up into the branch block.
...
llvm-svn: 63687
2009-02-04 00:03:08 +00:00
Devang Patel
4b56b3c66e
Do not let dbg intrinsic block folding of two entry phi node.
...
llvm-svn: 63671
2009-02-03 22:12:02 +00:00
Nick Lewycky
a676cf98e3
Revert r63600. It didn't fix the bug, it just moved it a bit.
...
llvm-svn: 63618
2009-02-03 06:30:37 +00:00
Nick Lewycky
cd8353b6fe
Update the callgraph when replacing InvokeInst with CallInst when inlining.
...
llvm-svn: 63600
2009-02-03 04:34:40 +00:00
Gabor Greif
690930270b
use precise getters
...
llvm-svn: 63402
2009-01-30 18:21:13 +00:00
Duncan Sands
aee16d4916
Rename getAnalysisToUpdate to getAnalysisIfAvailable.
...
llvm-svn: 63198
2009-01-28 13:14:17 +00:00
Dale Johannesen
b818fa1bd3
Revert previous change; even this mild and clearly
...
more accurate change loses more than it gains on
benchmarks.
llvm-svn: 62938
2009-01-24 21:49:34 +00:00
Dale Johannesen
1867040e00
Improve the inlining cost function a bit.
...
Little practical effect.
llvm-svn: 62908
2009-01-24 01:27:33 +00:00
Gabor Greif
fbd40904c1
Simplify the logic of getting hold of a PHI predecessor block.
...
There is now a direct way from value-use-iterator to incoming block in PHINode's API.
This way we avoid the iterator->index->iterator trip, and especially the costly
getOperandNo() invocation. Additionally there is now an assertion that the iterator
really refers to one of the PHI's Uses.
llvm-svn: 62869
2009-01-23 19:40:15 +00:00
Chris Lattner
6ade48fcaa
another fix for PR3354
...
llvm-svn: 62561
2009-01-20 01:15:41 +00:00
Bill Wendling
5281f4fb64
Doxygen-ify comments.
...
llvm-svn: 62546
2009-01-19 23:43:56 +00:00
Chris Lattner
e8fa6f2468
Fix a problem exposed by PR3354: simplifycfg was making a potentially
...
trapping instruction be executed unconditionally.
llvm-svn: 62541
2009-01-19 23:03:13 +00:00
Bill Wendling
bf83203ae6
Temporarily revert r62487. It's causing this error during a release bootstrap of
...
llvm-gcc. Most likely, it's miscompiling one of the "gen*" programs:
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./prev-gcc/xgcc -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./prev-gcc/ -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.6.0/bin/ -c -g -O2 -mdynamic-no-pic -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -mdynamic-no-pic -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/build -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/../llvm.src/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -o build/gencondmd.o build/gencondmd.c
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: error: expected '}' before ')' token
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: warning: excess elements in struct initializer
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: warning: (near initialization for 'insn_conditions[4]')
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: error: expected '}' before ')' token
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: error: expected ',' or ';' before ')' token
../../llvm-gcc.src/gcc/config/i386/mmx.md:927: error: expected identifier or '(' before ',' token
../../llvm-gcc.src/gcc/config/i386/sse.md:3458: error: expected identifier or '(' before ',' token
...
llvm-svn: 62506
2009-01-19 08:46:20 +00:00
Chris Lattner
bb76cc9447
Fix PR3016, a bug which can occur do to an invalid assumption:
...
we assumed a CFG structure that would be valid when all code in
the function is reachable, but not all code is necessarily
reachable. Do a simple, but horrible, CFG walk to check for this
case.
llvm-svn: 62487
2009-01-19 02:46:28 +00:00
Chris Lattner
af6f58bbf4
reduce indentation by using 'continue', no functionality change.
...
llvm-svn: 62477
2009-01-19 02:07:32 +00:00