Commit Graph

31391 Commits

Author SHA1 Message Date
Chris Lattner
35c3531754 fix COFF targets (mingw/cygwin) to provide ehframe and LSDA sections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 16:56:17 +00:00
Dan Gohman
c40f17b087 Generalize ScalarEvolution to be able to analyze GEPs when
TargetData is not present. It still uses TargetData when available.
This generalization also fixed some limitations in the TargetData
case; the attached testcase covers this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79344 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 16:46:41 +00:00
Chris Lattner
4d35fce60c null streamer needs to maintain the current section as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 16:46:29 +00:00
Dan Gohman
da65822cfc Make tail merging handle blocks with repeated predecessors correctly, and
remove RemoveDuplicateSuccessor, as it is no longer necessary, and because
it breaks assumptions made in
MachineBasicBlock::isOnlyReachableByFallthrough.

Convert test/CodeGen/X86/omit-label.ll to FileCheck and add a testcase
for PR4732.

test/CodeGen/Thumb2/thumb2-ifcvt2.ll sees a diff with this commit due to
it being bugpoint-reduced to the point where it doesn't matter what the
condition for the branch is.

Add some more interesting code to
test/CodeGen/X86/2009-08-06-branchfolder-crash.ll, which is the testcase
that originally motivated the RemoveDuplicateSuccessor code, to help
verify that the original problem isn't being re-broken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79338 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 15:18:18 +00:00
Dan Gohman
6874a2ae03 Fix a bug that caused globalopt to miscompile tramp3d: don't miss
unruly indices for arrays that are members of structs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 14:58:19 +00:00
Anton Korobeynikov
848c293962 Text sections should have 'exec' flag set. This seems to unbreak libstdc++ on linux.
Patch by Dmitry Gorbachev!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79334 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 14:06:12 +00:00
Daniel Dunbar
b26bc42a2c Fix Triple to recognize the 'bfin' arch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79325 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 07:06:26 +00:00
Chris Lattner
dabf07c70a Make AsmStreamer maintain a notion of the current section, pushing it up from the
MCAsmStreamer.  Based on this, eliminate the current section from AsmPrinter.

While I'm at it, clean up the last of the horrible "switch to null section" stuff
and add an assert.  This change is in preparation for completely eliminating 
asmprinter::switchtosection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79324 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 06:15:16 +00:00
Chris Lattner
6a66e585b8 add a horrible hack to the dwarf printer. It looks like mingw is not specifying
an EHFrame section, so we just emit ehframe data into a random section.

This is clearly bad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79323 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 06:13:03 +00:00
Chris Lattner
090d73c6bd remove some pointless null switchtosections. The IntelAsmPrinter doesn't really work anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79321 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 06:03:07 +00:00
Evan Cheng
51f39961c3 Fix revsh pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 05:43:23 +00:00
Chris Lattner
79e6408ad3 add support for some targetflags on GV operands. This allows us to
send instructions like:

NEW: 	movl	"L___stack_chk_guard$non_lazy_ptr" - "L1$pb"(%esi), %eax
OLD: 	movl	L___stack_chk_guard$non_lazy_ptr-"L1$pb"(%esi), %eax

through the streamer.  Several fixmes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79317 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 05:33:27 +00:00
Daniel Dunbar
2447389bac Recognize xscale as an ARM arch.
- Patch by Yonggang Luo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79315 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 04:51:26 +00:00
Daniel Dunbar
fdb0b7b555 Add Triple matching for pic16 arch and solaris OS.
- Patch by Yonggang Luo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79314 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 04:43:27 +00:00
Chris Lattner
1f50fc736e fix another bozo bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79313 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 04:34:36 +00:00
Chris Lattner
b49a30c109 fix accidentally inverted conditional and add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79312 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 04:33:15 +00:00
Chris Lattner
a006d4e60d turn this conditional into something humans might actually
be able to understand ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79311 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 04:30:35 +00:00
Dan Gohman
8942f9bb9f Make TargetData optional in MemCpyOptimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79306 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 01:17:52 +00:00
Dan Gohman
f14d919742 Make TargetData optional in SimplifyLibCalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79298 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 00:48:13 +00:00
Anton Korobeynikov
e55db74152 The attached patches attempt to fix cross builds. For example, if you
try to use i686-darwin to build for arm-eabi, you'll quickly run into
several false assumptions that the target OS must be the same as the
host OS. These patches split $(OS) into $(HOST_OS) and $(TARGET_OS) to
help builds like "make check" and the test-suite able to cross
compile. Along the way a target of *-unknown-eabi is defined as
"Freestanding" so that TARGET_OS checks have something to work with.

Patch by Sandeep Patel!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79296 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 00:40:33 +00:00
Dan Gohman
25103a2617 Fix function alignment at -Os on x86 to be 1, not 2. getFunctionAlignment
returns a log2 value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79293 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 00:20:06 +00:00
Dale Johannesen
5cfd4ddece PowerPC inline asm was emitting two output operands
for a single "m" constraint; this is wrong because the
opcode of a load or store would have to change in parallel.
This patch makes it always compute addresses into a register,
which is correct but not as efficient as possible.  7144566.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79292 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 00:18:39 +00:00
Devang Patel
4b49cd298a Add prefix only if it is needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79289 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 23:17:17 +00:00
Jim Grosbach
606f3d696f cleanups per review. Mostly cosmetic, plus use SmallVector in place of std::vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79287 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 21:40:03 +00:00
Devang Patel
4c77dfa20c Oops. find all llvm.dbg.global_variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79274 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 20:36:20 +00:00
Jim Grosbach
2962664227 Remove a bit more cruft from the sjlj moving to a backend pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 20:25:04 +00:00
Benjamin Kramer
ae68a19ef9 Update CMakeLists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 18:47:11 +00:00
Dan Gohman
d802f7e290 Update comments to new-style syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79263 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 18:45:31 +00:00
Daniel Dunbar
5d17eddb0c Fix build warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 18:41:42 +00:00
Owen Anderson
7b7b102023 Privatize the last bits of static type state.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79258 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 17:59:35 +00:00
Owen Anderson
36a3eb0aaa Move the TypeMap lock to a member on LLVMContextImpl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79256 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 17:34:27 +00:00
Owen Anderson
596c1dc3e2 Add locking around the attributes list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79255 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 17:10:58 +00:00
Owen Anderson
6ae8c73aca Add locking around signal handler registration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 17:07:22 +00:00
Benjamin Kramer
76d5ccf6af Clear the uniquing table when initializing TLOF to avoid a crash when the TLOF is reinitialized with a different MCContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79253 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 17:05:44 +00:00
Nick Lewycky
a10e89f372 Don't crash on critical edge. Patch by Andre Tavares.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 17:00:57 +00:00
Jim Grosbach
8b818d7e98 Move the sjlj exception handling conversions to a back-end pass where they
more properly belong. This allows removing the front-end conditionalized
SJLJ code, and cleans up the generated IR considerably. All of the
infrastructure code (calling _Unwind_SjLj_Register/Unregister, etc) is
added by the SjLjEHPrepare pass.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79250 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 16:41:22 +00:00
Richard Osborne
2a5e23b44d Update getSectionForConstant() to to allow mergable sections to be nulled out
if not supported by the ELF subtarget.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79249 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 16:37:11 +00:00
David Goodwin
fac8541dd4 Extend the instruction itinerary model to include the ability to indicate the def and use cycle for each operand. This additional information is optional, so existing itineraries do not need to be changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 16:02:57 +00:00
Chris Lattner
8f4b1ec02b the MinPad argument to PadToColumn only really makes sense to be 1,
just remove the argument and replace it with 1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 15:48:08 +00:00
Dan Gohman
094ae454e8 Fix more missing newlines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79244 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 15:29:31 +00:00
Dan Gohman
48cc73d9c7 Fix printing of instructions with null operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79243 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 15:28:08 +00:00
Dan Gohman
e04853ca78 Always print at least one space before adding a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79242 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 15:27:30 +00:00
Dan Gohman
8732577230 Fix debug output to include a newline after printing a Value, now
that Value's operator<< doesn't include one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 15:25:05 +00:00
Duncan Sands
fa6a1cf1ed Don't access the first element of a potentially empty
vector (&Formals[0]).  With this change llvm-gcc builds
with expensive checking enabled for C, C++ and Fortran.
While there, change a std::vector into a SmallVector.
This is partly gratuitous, but mostly because not all
STL vector implementations define the data method (and
it should be faster).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79237 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 14:33:27 +00:00
Chris Lattner
975780bb59 change AsmPrinter to switch sections using AsmStreamer instead of
doing it directly.  This requires const'izing a bunch of stuff that
took sections, but this seems like the right semantic thing to do:
emitting a label to a section shouldn't mutate the MCSection object
itself, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 05:49:08 +00:00
Nick Lewycky
d3aa25e2a8 Don't crash trying to promote VLAs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79226 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 05:37:31 +00:00
Chris Lattner
f3ce009fcb give MCAsmStreamer a TargetAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79222 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 04:23:44 +00:00
Chris Lattner
46a947d8c1 formatting cleanups, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 04:17:34 +00:00
Erick Tryzelaar
e0a1bf64c9 Expose creating constant ints and floats from strings in llvm-c.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79213 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 23:36:46 +00:00
Erick Tryzelaar
0e81f660db Add helper functions to ConstantInt and ConstantFP to accept strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79212 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 23:36:33 +00:00