Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

LLVM ERROR: Undefined temporary symbol from llvm-bolt, no binary generated #20

Closed
jshufro opened this issue Jun 27, 2018 · 4 comments
Closed
Assignees

Comments

@jshufro
Copy link

jshufro commented Jun 27, 2018

Invocation as
> sudo PATH=$PATH:build/bin build/bin/llvm-bolt cookiemonster -o cookiemonster.bolt reorder-blocks=cache+ -reorder-functions=hfsort+ -split-functions=3 -split-all-cold -split-eh -dyno-stats -update-debug-sections -data=perf.fdata

results in output

BOLT-INFO: first alloc address is 0x400000
BOLT-INFO: creating new program header table at address 0x4e00000, offset 0x4a00000
BOLT-INFO: enabling relocation mode
BOLT-INFO: forcing -jump-tables=move as PIC jump table was detected
BOLT-INFO: 704 functions out of 7668 simple functions (9.2%) have non-empty execution profile.
BOLT-INFO: 194 non-simple function(s) have profile.
BOLT-INFO: profile for 1 objects was ignored
BOLT-INFO: the input contains 348 (dynamic count : 498927) missed opportunities for macro-fusion optimization. Will fix instances on a hot path.
BOLT-INFO: removed 32 'repz' prefixes with estimated execution count of 0 times.
BOLT-INFO: UCE removed 1413 blocks and 26003 bytes of code.
BOLT-INFO: running hfsort+ for 709 functions
BOLT-INFO: program-wide dynostats after all optimizations before SCTC and FOP:

            34106516 : executed forward branches
             7414759 : taken forward branches
            15375720 : executed backward branches
             8358219 : taken backward branches
             4648654 : executed unconditional branches
            19960039 : all function calls
             7434182 : indirect calls
             6583156 : PLT calls
           377604140 : executed instructions
            92739869 : executed load instructions
            59455877 : executed store instructions
               28577 : taken jump table branches
            54130890 : total branches
            20421632 : taken branches
            33709258 : non-taken conditional branches
            15772978 : taken conditional branches
            49482236 : all conditional branches

            33780793 : executed forward branches (-1.0%)
             7267644 : taken forward branches (-2.0%)
            15375694 : executed backward branches (-0.0%)
             8358193 : taken backward branches (-0.0%)
             4346996 : executed unconditional branches (-6.5%)
            19781435 : all function calls (-0.9%)
             7434182 : indirect calls (=)
             6583156 : PLT calls (=)
           373937996 : executed instructions (-1.0%)
            91209281 : executed load instructions (-1.7%)
            59455774 : executed store instructions (-0.0%)
               28577 : taken jump table branches (=)
            53503483 : total branches (-1.2%)
            19972833 : taken branches (-2.2%)
            33530650 : non-taken conditional branches (-0.5%)
            15625837 : taken conditional branches (-0.9%)
            49156487 : all conditional branches (-0.7%)

BOLT-INFO: SCTC: patched 105 tail calls (104 forward) tail calls (1 backward) from a total of 105 while removing 0 double jumps and removing 74 basic blocks totalling 370 bytes of code. CTCs total execution count is 2 and the number of times CTCs are taken is 0.
LLVM ERROR: Undefined temporary symbol

I'm at a loss for what could cause this.

@jshufro
Copy link
Author

jshufro commented Jun 27, 2018

Here's -v output around the failing section:

BOLT-INFO: Finished pass: print dyno-stats after optimizations
BOLT-INFO: Starting pass: simplify-conditional-tail-calls
BOLT-INFO: SCTC: patched 105 tail calls (104 forward) tail calls (1 backward) from a total of 105 while removing 0 double jumps and removing 74 basic blocks totalling 370 bytes of code. CTCs total execution count is 2 and the number of times CTCs are taken is 0.
BOLT-INFO: Finished pass: simplify-conditional-tail-calls
BOLT-INFO: Starting pass: aligner
BOLT-INFO: Finished pass: aligner
BOLT-INFO: Starting pass: reorder-data
BOLT-INFO: Finished pass: reorder-data
BOLT-INFO: Starting pass: finalize-functions
BOLT-INFO: Finished pass: finalize-functions
BOLT-INFO: Starting pass: frame-optimizer
BOLT-INFO: Finished pass: frame-optimizer
BOLT-INFO: Starting pass: alloc-combiner
BOLT-INFO: Finished pass: alloc-combiner
BOLT-INFO: Starting pass: inst-lowering
BOLT-INFO: Finished pass: inst-lowering
BOLT-INFO: Starting pass: lower-annotations
BOLT-INFO: Finished pass: lower-annotations
LLVM ERROR: Undefined temporary symbol

@jshufro
Copy link
Author

jshufro commented Jun 27, 2018

Failing message looks to be emitted from ELFObjectWriter::computeSymbolTable

@maksfb
Copy link
Contributor

maksfb commented Jun 27, 2018

It looks like you've hit a bug with our unreachable code elimination optimization. Thanks for reporting it! As a workaround, could you try to run BOLT with additional flags -eliminate-unreachable=0 -simplify-conditional-tail-calls=0?

@jshufro
Copy link
Author

jshufro commented Jun 27, 2018

That looks to be a viable workaround- thanks!

@rafaelauler rafaelauler self-assigned this Jul 3, 2018
rafaelauler added a commit that referenced this issue May 10, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue May 11, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
aaupov pushed a commit that referenced this issue May 12, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue May 25, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue May 25, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue May 27, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue Jun 4, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue Jun 18, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
aaupov pushed a commit that referenced this issue Jun 25, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue Jul 6, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue Jul 16, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue Jul 21, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue Jul 23, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue Aug 5, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue Aug 6, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue Aug 17, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue Aug 25, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue Sep 2, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
rafaelauler added a commit that referenced this issue Sep 9, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from commit b12d104bea21ac9b90be98599258db4aa5f6dbdd)
aaupov pushed a commit that referenced this issue Dec 31, 2021
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from FBD8730269)
maksfb pushed a commit that referenced this issue Jan 10, 2022
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from FBD8730269)
maksfb pushed a commit that referenced this issue Jan 11, 2022
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from FBD8730269)
maksfb pushed a commit that referenced this issue Jan 11, 2022
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes #20

(cherry picked from FBD8730269)
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this issue Oct 7, 2022
Summary:
While removing unreachable blocks, we may decide to remove a
block that is listed as a target in a jump table entry. If we do that,
this label will be then undefined and LLVM assembler will crash.
Mitigate this for now by not removing such blocks, as we don't support
removing unnecessary jump tables yet.

Fixes facebookarchive/BOLT#20

(cherry picked from FBD8730269)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants