Page MenuHomePhabricator

[CodeGen] Check the number of operands before accessing the first one
AcceptedPublic

Authored by phosek on Aug 6 2020, 12:51 PM.

Details

Reviewers
MaskRay
pcc
Summary

After D72899, it's possible to use empty associated symbol which will
get lowered to sh_link set to 0. However, if the operand is missing
altogether, getLinkedToSymbol is going to fail. Avoid the failure
by checking the number of arguments first.

Diff Detail

Unit TestsFailed

TimeTest
50 mslinux > Polly.Isl/Ast::alias_checks_with_empty_context.ll
Script: -- : 'RUN: at line 1'; opt -polly-process-unprofitable -polly-remarks-minimal -polly-use-llvm-names -polly-import-jscop-dir=/mnt/disks/ssd0/agent/llvm-project/polly/test/Isl/Ast -polly-codegen-verify -polly-ast -analyze < /mnt/disks/ssd0/agent/llvm-project/polly/test/Isl/Ast/alias_checks_with_empty_context.ll | FileCheck /mnt/disks/ssd0/agent/llvm-project/polly/test/Isl/Ast/alias_checks_with_empty_context.ll

Event Timeline

phosek created this revision.Aug 6 2020, 12:51 PM
MaskRay accepted this revision.Aug 9 2020, 2:45 PM

LGTM if the regression test will be added in D76802 or elsewhere

This revision is now accepted and ready to land.Aug 9 2020, 2:45 PM