This is an archive of the discontinued LLVM Phabricator instance.

[IR] Fix getPointerAlignment for CallBase
ClosedPublic

Authored by uenoku on Jul 25 2019, 6:58 AM.

Details

Summary

In current getPointerAlignemnt implementation, CallBase.getPointerAlignement(..) checks only parameter attriutes in the callsite. For example,

declare align 8 i8* @foo()

define void @bar() {
    %a = tail call align 8 i8* @foo() ; getPointerAlignment returns 8
    %b = tail call i8* @foo() ; getPointerAlignemnt returns 0
    ret void
}

This patch will fix the problem.

Diff Detail

Repository
rL LLVM

Event Timeline

uenoku created this revision.Jul 25 2019, 6:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 25 2019, 6:58 AM
jdoerfert accepted this revision.Jul 25 2019, 4:04 PM

LGTM, looks straight forward

This revision is now accepted and ready to land.Jul 25 2019, 4:04 PM
This revision was automatically updated to reflect the committed changes.