This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Update LiveVariables in convertToThreeAddress()
ClosedPublic

Authored by ruiling on Oct 8 2020, 8:28 PM.

Details

Summary

This can fix an asan failure like below.

15856==ERROR: AddressSanitizer: use-after-poison on address ...

READ of size 8 at 0x6210001a3cb0 thread T0

#0 llvm::MachineInstr::getParent()
#1 llvm::LiveVariables::VarInfo::findKill()
#2 TwoAddressInstructionPass::rescheduleMIBelowKill()
#3 TwoAddressInstructionPass::tryInstructionTransform()
#4 TwoAddressInstructionPass::runOnMachineFunction()

We need to update the Kills if we replace instructions. The Kills
may be later accessed within TwoAddressInstruction pass.

Diff Detail

Event Timeline

ruiling created this revision.Oct 8 2020, 8:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 8 2020, 8:28 PM
ruiling requested review of this revision.Oct 8 2020, 8:28 PM

@arsenm Do you know how to run llc with sanitizer enabled?

arsenm added a comment.Oct 9 2020, 5:35 PM

@arsenm Do you know how to run llc with sanitizer enabled?

You don't specifically run the test with it. You just add one that would fail in a sanitizer build

ruiling updated this revision to Diff 297387.Oct 9 2020, 11:35 PM

add a test case.

arsenm accepted this revision.Oct 12 2020, 7:24 AM
This revision is now accepted and ready to land.Oct 12 2020, 7:24 AM
This revision was automatically updated to reflect the committed changes.