Skip to content
Commit a253a0bb authored by She Dongrui's avatar She Dongrui Committed by Adrian Prantl
Browse files

Avoid removing useful loop metadata when stripping debug info

The stripDebugLocFromLoopID() may mistakenly remove useful metadata nodes
when they are operands of a child node, which also has DILocation operands.

It can be reproduced by the output of clang for code similar to the following:

for(int i = 0; i < n; i++)
  x[i] = 10;
-strip-debug removes the child node of llvm.loop.vectorize.followup_all,
which contains llvm.loop.isvectorized and llvm.loop.unroll.count.

This patch fixes by checking all children nodes and only remove a metadata
node if all its children are DILocation.

Differential Revision: https://reviews.llvm.org/D141909
parent 49055502
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment