diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-03-18 18:42:41 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-03-18 18:42:41 +0000 |
commit | d1ec31dca534a8816d7f2fcbfdc7ed4476b471d3 (patch) | |
tree | 774413147f4a222106266f4cee1b6f7e1d18e953 /include | |
parent | 74cdc75313974456d1f040ca2dca33f16a18f9b3 (diff) | |
download | external_llvm-d1ec31dca534a8816d7f2fcbfdc7ed4476b471d3.zip external_llvm-d1ec31dca534a8816d7f2fcbfdc7ed4476b471d3.tar.gz external_llvm-d1ec31dca534a8816d7f2fcbfdc7ed4476b471d3.tar.bz2 |
Fix pr6543: svn r88806 changed MachineJumpTableInfo::getJumpTableIndex() to
always create a new jump table. The intention was to avoid merging jump
tables in SelectionDAGBuilder, and to wait for the branch folding pass to
merge tables. Unfortunately, the same getJumpTableIndex() method is also
used to merge tables in branch folding, so as a result of this change
branch tables are never merged. Worse, the branch folding code is expecting
getJumpTableIndex to always return the index of an existing table, but with
this change, it never does so. In at least some cases, e.g., pr6543, this
creates references to non-existent tables.
I've fixed the problem by adding a new createJumpTableIndex function, which
will always create a new table, and I've changed getJumpTableIndex to only
look at existing tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98845 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/MachineJumpTableInfo.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineJumpTableInfo.h b/include/llvm/CodeGen/MachineJumpTableInfo.h index b8d04bf..85d38ba 100644 --- a/include/llvm/CodeGen/MachineJumpTableInfo.h +++ b/include/llvm/CodeGen/MachineJumpTableInfo.h @@ -83,7 +83,11 @@ public: /// getEntryAlignment - Return the alignment of each entry in the jump table. unsigned getEntryAlignment(const TargetData &TD) const; - /// getJumpTableIndex - Create a new jump table or return an existing one. + /// createJumpTableIndex - Create a new jump table. + /// + unsigned createJumpTableIndex(const std::vector<MachineBasicBlock*> &DestBBs); + + /// getJumpTableIndex - Return the index for an existing jump table. /// unsigned getJumpTableIndex(const std::vector<MachineBasicBlock*> &DestBBs); |