Page MenuHomePhabricator

[NVPTX] Fix PR41651
ClosedPublic

Authored by hliao on Jul 30 2019, 12:12 PM.

Details

Summary
  • Use the reliable way to retrive the IR module from callsite. As the indirect callsite doesn't have a called function, it would crash the compiler. Retrive the module from CS's call instruction instead.

Diff Detail

Repository
rL LLVM

Event Timeline

hliao created this revision.Jul 30 2019, 12:12 PM
tra added a reviewer: tra.Jul 30 2019, 12:21 PM
tra added inline comments.Jul 30 2019, 12:25 PM
llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
1296 ↗(On Diff #212407)

Can we just use DAG.getDataLayout() as we do everywhere else?

hliao marked an inline comment as done.Jul 30 2019, 12:39 PM
hliao added inline comments.
llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
1296 ↗(On Diff #212407)

Unfortunately, either DAG or CLI (CallLoweringInfo) is not passed as parameter. Without changing prototype of that function, get data layout from CS is the trivial way.

hliao marked an inline comment as done.Jul 30 2019, 12:41 PM
hliao added inline comments.
llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
1296 ↗(On Diff #212407)

Wait, DL is passed as parameter, I will simplify the patch

hliao updated this revision to Diff 212413.Jul 30 2019, 12:43 PM

simplify the patch

tra accepted this revision.Jul 30 2019, 12:46 PM
tra added inline comments.
llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
1296 ↗(On Diff #212407)

Even better! :-)

This revision is now accepted and ready to land.Jul 30 2019, 12:46 PM
Closed by commit rL367349: [NVPTX] Fix PR41651 (authored by hliao, committed by ). · Explain WhyJul 30 2019, 12:53 PM
This revision was automatically updated to reflect the committed changes.