This is an archive of the discontinued LLVM Phabricator instance.

[X86DomainReassignment] Don't compare stack-allocated values by address
ClosedPublic

Authored by loladiro on May 12 2018, 6:32 PM.

Details

Summary

The Closure allocated in the main loop is allocated on the stack. However,
later in the code its address is taken (and used for comparisons). This
obviously doesn't work. In fact, the Closure will get the same stack address
during every loop iteration, rendering the check that intended to identify
Closure conflicts entirely ineffective. Fix this bug by giving every Closure
a unique ID and using that for comparison. Alternatively, we could heap
allocate the closure object.

Fixes PR37396
Fixes JuliaLang/julia#27032

Diff Detail

Repository
rL LLVM

Event Timeline

loladiro created this revision.May 12 2018, 6:32 PM
craig.topper added inline comments.May 13 2018, 3:57 PM
lib/Target/X86/X86DomainReassignment.cpp
336 ↗(On Diff #146493)

Won't this be unused in release builds? Will that cause an error?

338 ↗(On Diff #146493)

Capitalize variable name

loladiro added inline comments.May 16 2018, 5:46 PM
lib/Target/X86/X86DomainReassignment.cpp
336 ↗(On Diff #146493)

Fair point, I'll annotate this this with LLVM_DUMP_METHOD.

loladiro updated this revision to Diff 147221.May 16 2018, 5:57 PM

Add LLVM_DUMP_METHOD to the added dump() method.

This revision is now accepted and ready to land.May 16 2018, 9:47 PM
This revision was automatically updated to reflect the committed changes.